Forum How do I...?

Can we influence the order absolutely positioned elements are "ordered"?

jordan.gibson
For context, this is largely in regards to how screen readers will read the resulting PDF.

Take the following HTML:

    <div>
      <div
        style="
          position: absolute;
          top: 6in;
          left: 0.65625in;
          width: 6.958333333333333in;
          height: 4.90625in;
        "
      >
        <span>Some text that should be read second...</span>
      </div>
      <div
        style="
          position: absolute;
          top: 2.0729166666666665in;
          left: 0.6145833333333334in;
          width: 6.041666666666667in;
          height: 2.3958333333333335in;
        "
      >
        <span>Some text that should be read first...</span>
      </div>
    </div>


This is naturally one of the issues with accessibility using absolutely positioned elements, but here the second div in the dom appears before the first div because of how they are positioned, but a Screen Reader will read the text of the first div, first.

Of course in this case a screen reader will have the same problem when reading the html itself. Our focus though at the moment is whether or not we can have any influence over the resulting order in which elements are created when converted to PDF so that a screen reader, reading the resulting PDF from the html above, would read the text of the second div first.

Thanks for any help or suggestions in advance!