How to indicate two html sections are continuation of each other

Gema Beltran

Are there any attributes or is there a way to indicate that two sections are a continuation of each other. Example below:

<section id="section-top">
    <div>Item 1 </div>
    <div>Item 2 </div>
</section>
<section id="section-bottom">
    <div>Item 3 </div>
    <div>Item 4 </div>
</section>

I need to keep things in separate sections because section-bottom is hidden until an expanding button is pressed. So when it displays, i need to indicate that its a part of the first list so that narrator reads 3/4 when you arrow down into item three instead of 1/2 because its in a separate section.

Is this possible?

Shannon Young

The structure of your example HTML is not semantically correct, that said you can use aria roles and attributes to expose the intended meaning to screen-readers.


Markup

<section aria-label="Group of things">
  <div role="list">
    <section role="none presentation" id="section-top"> 
      <div role="listitem">
        <p>Thing 1</p>
      </div>
      <div role="listitem">
        <p>Thing 2</p>
      </div>
    </section> 
    <section role="none presentation" id="section-bottom"> 
      <div role="listitem" hidden>
        <p>Thing 3</p>
      </div>
      <div role="listitem" hidden>
        <p>Thing 4</p>
      </div>
    </section> 
  </div>
</section>

Explanation

  • Wrap your original <section> elements in a <div> with role=list.

    Lists contain children whose role is listitem, or elements whose role is group which in turn contains children whose role is listitem.

  • Wrap the <div> with role=list inside another <section> element, and use the aria-label attribute to transform it into a region, and give it an accessible name.

    <section>, region when it has an accessible name using aria-labelledby, aria-label or title attribute.

  • Your original <section> elements have been given the role=presentation to negate the implicit role semantics but not affect the contents.
  • Your original <div> elements have been given role=listitem.

    Authors MUST ensure elements with role=listitem are contained in, or owned by, an element with the role list or group.

  • Your initially hidden other elements have been given the hidden attribute, and you will need to follow up yourself with the useful answer from codeMonkey on how you show/hide these.

    "…because section-bottom is hidden until an expanding button is pressed."

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Placing two sections next to each other in a UICollectionView

From Dev

For Each in rails html pattern continuation

From Dev

How to show two radio button next to each other in html?

From Dev

How to make a two date picker depend on each other in html?

From Dev

Cannot get two sections next to each other without screwing up other things

From Dev

How to remove this gap between two sections (one on top of the other)?

From Dev

How to have one html table split into two sections, side by side?

From Dev

Display two inputs next to each other with label above each html

From Dev

Align 2 sections next to each other in responsive

From Dev

2 sections or divs displayed next to each other

From Dev

Creating Sections That Are Independent Of Each Other in UITableView

From Dev

2 sections or divs displayed next to each other

From Dev

sections sit on top of each other in absolute

From Dev

How to prove that two strings are permutations of each other?

From Dev

How to put two ul next each other?

From Dev

How to put two divs next to each other?

From Java

How to place two divs next to each other?

From Dev

How to map two String[] to each other

From Dev

How to add two views on each other with constraints

From Dev

How to place two Tspan on top of each other

From Dev

how to make two classes friend of each other?

From Dev

Query two columns that reference each other, how to?

From Dev

How to find if two rows are similar to each other?

From Dev

How to put two subnets next to each other?

From Dev

How to arranging two div beside each other?

From Dev

How to fix two label overlap each other

From Dev

How to add two views on each other with constraints

From Dev

How to make two coordinates match each other?

From Dev

How to properly loop two functions to each other

Related Related

  1. 1

    Placing two sections next to each other in a UICollectionView

  2. 2

    For Each in rails html pattern continuation

  3. 3

    How to show two radio button next to each other in html?

  4. 4

    How to make a two date picker depend on each other in html?

  5. 5

    Cannot get two sections next to each other without screwing up other things

  6. 6

    How to remove this gap between two sections (one on top of the other)?

  7. 7

    How to have one html table split into two sections, side by side?

  8. 8

    Display two inputs next to each other with label above each html

  9. 9

    Align 2 sections next to each other in responsive

  10. 10

    2 sections or divs displayed next to each other

  11. 11

    Creating Sections That Are Independent Of Each Other in UITableView

  12. 12

    2 sections or divs displayed next to each other

  13. 13

    sections sit on top of each other in absolute

  14. 14

    How to prove that two strings are permutations of each other?

  15. 15

    How to put two ul next each other?

  16. 16

    How to put two divs next to each other?

  17. 17

    How to place two divs next to each other?

  18. 18

    How to map two String[] to each other

  19. 19

    How to add two views on each other with constraints

  20. 20

    How to place two Tspan on top of each other

  21. 21

    how to make two classes friend of each other?

  22. 22

    Query two columns that reference each other, how to?

  23. 23

    How to find if two rows are similar to each other?

  24. 24

    How to put two subnets next to each other?

  25. 25

    How to arranging two div beside each other?

  26. 26

    How to fix two label overlap each other

  27. 27

    How to add two views on each other with constraints

  28. 28

    How to make two coordinates match each other?

  29. 29

    How to properly loop two functions to each other

HotTag

Archive