|
| 1 | +--- |
| 2 | +{ |
| 3 | + "title": "Grouping Content - Scaffolding", |
| 4 | + "language": "en", |
| 5 | + "altLangPage": "grouping-fr.html", |
| 6 | + "dateModified": "2025-04-15" |
| 7 | +} |
| 8 | +--- |
| 9 | + |
| 10 | +<div class="wb-prettify all-pre"></div> |
| 11 | + |
| 12 | +<div class="alert alert-info"> |
| 13 | +<p>The purpose of this page is to test all native content grouping related elements, if they are aligned with our design and are compliant to our accessibility guideline when used as is without any special customization. The following include all content grouping elements in the HTML5 specification and a few examples was inspired by the <a href="https://html.spec.whatwg.org/multipage/grouping-content.html#grouping-content">WHATWG section 4.4</a> as of April 2025. This page may not contain all the possible grouping content element combination.</p> |
| 14 | +</div> |
| 15 | + |
| 16 | +<h2>The <code>p</code> element</h2> |
| 17 | +<p>This is some text in a paragraph.</p> |
| 18 | +<pre><code><p> ... </p></code></pre> |
| 19 | + |
| 20 | +<h2>The <code>hr</code> element</h2> |
| 21 | +<hr> |
| 22 | +<pre><code><hr></code></pre> |
| 23 | + |
| 24 | +<h2>The <code>pre</code> element</h2> |
| 25 | +<pre>Here is some pre formatted text</pre> |
| 26 | +<pre><code><pre> ... </pre></code></pre> |
| 27 | + |
| 28 | +<h2>The <code>blockquote</code> element</h2> |
| 29 | +<blockquote> |
| 30 | + <p>This is a blockquote example</p> |
| 31 | +</blockquote> |
| 32 | +<pre><code><blockquote> |
| 33 | + <p> ... </p> |
| 34 | +</blockquote></code></pre> |
| 35 | + |
| 36 | +<h3 id="bqWithAuthor">Example with author</h3> |
| 37 | +<figure> |
| 38 | + <blockquote> |
| 39 | + <p>"No man ever steps in the same river twice, for it's not the same river and he's not the same man."</p> |
| 40 | + </blockquote> |
| 41 | + <figcaption>Heraclitus, <cite>Fragments</cite></figcaption> |
| 42 | +</figure> |
| 43 | +<pre><code><figure> |
| 44 | + <blockquote> |
| 45 | + <p>"No man ever steps in the same river twice, for it's not the same river and he's not the same man."</p> |
| 46 | + </blockquote> |
| 47 | + <figcaption>Heraclitus, <cite>Fragments</cite></figcaption> |
| 48 | +</figure></code></pre> |
| 49 | + |
| 50 | +<h3>Invalid example</h3> |
| 51 | +<p>2025-04 - The following design pattern was visible in the generic content page, but contained invalid HTML. Please use the <a href="#bqWithAuthor">above code</a> instead.</p> |
| 52 | +<pre><code><del><blockquote> |
| 53 | + <p>"<code>blockquote</code>"</p> |
| 54 | + <footer><code>footer</code> <cite><code>cite</code></cite></footer> |
| 55 | +</blockquote> |
| 56 | +</del></code></pre> |
| 57 | + |
| 58 | +<h2>The <code>ol</code> and <code>li</code> elements</h2> |
| 59 | +<ol> |
| 60 | + <li>Switzerland</li> |
| 61 | + <li>United Kingdom</li> |
| 62 | + <li>United States</li> |
| 63 | + <li>Norway</li> |
| 64 | +</ol> |
| 65 | +<pre><code><ol> |
| 66 | + <li>...</li> |
| 67 | + <li>...</li> |
| 68 | + <li>...</li> |
| 69 | +</ol></code></pre> |
| 70 | + |
| 71 | +<h2>The <code>ul</code> and <code>li</code> element.</h2> |
| 72 | +<ul> |
| 73 | + <li>Norway</li> |
| 74 | + <li>Switzerland</li> |
| 75 | + <li>United Kingdom</li> |
| 76 | + <li>United States</li> |
| 77 | +</ul> |
| 78 | +<pre><code><ul> |
| 79 | + <li>...</li> |
| 80 | + <li>...</li> |
| 81 | + <li>...</li> |
| 82 | +</ul></code></pre> |
| 83 | + |
| 84 | +<h2>The <code>menu</code> and <code>li</code> elements</h2> |
| 85 | +<menu> |
| 86 | + <li><button>Copy</button></li> |
| 87 | + <li><button>Cut</button></li> |
| 88 | + <li><button>Paste</button></li> |
| 89 | + <li>List item</li> |
| 90 | + <li><a href="#">Anchor</a></li> |
| 91 | +</menu> |
| 92 | +<pre><code><menu> |
| 93 | + <li>...</li> |
| 94 | + <li>...</li> |
| 95 | + <li>...</li> |
| 96 | +</menu></code></pre> |
| 97 | + |
| 98 | +<h2>The <code>dl</code>, <code>dd</code>, and <code>dt</code> elements</h2> |
| 99 | +<dl> |
| 100 | + <dt>Term 1</dt> |
| 101 | + <dd>Description 1</dd> |
| 102 | + <dt>Term 2</dt> |
| 103 | + <dd>Description 2</dd> |
| 104 | +</dl> |
| 105 | +<pre><code><dl> |
| 106 | + <dt>Term 1</dt> |
| 107 | + <dd>Description 1</dd> |
| 108 | + <dt>Term 2</dt> |
| 109 | + <dd>Description 2</dd> |
| 110 | +</dl></code></pre> |
| 111 | + |
| 112 | +<h3>With two consecutive description </h3> |
| 113 | +<dl> |
| 114 | + <dt>Authors</dt> |
| 115 | + <dd>John</dd> |
| 116 | + <dd>Luke</dd> |
| 117 | + <dt>Editor</dt> |
| 118 | + <dd>Frank</dd> |
| 119 | +</dl> |
| 120 | +<pre><code><dl> |
| 121 | + <dt>Authors</dt> |
| 122 | + <dd>John</dd> |
| 123 | + <dd>Luke</dd> |
| 124 | + <dt>Editor</dt> |
| 125 | + <dd>Frank</dd> |
| 126 | +</dl></code></pre> |
| 127 | + |
| 128 | +<h3>With two consecutive terms</h3> |
| 129 | +<dl> |
| 130 | + <dt lang="en-US">color</dt> |
| 131 | + <dt lang="en-GB">colour</dt> |
| 132 | + <dd>A sensation which (in humans) derives from the ability of |
| 133 | + the fine structure of the eye to distinguish three differently |
| 134 | + filtered analyses of a view.</dd> |
| 135 | +</dl> |
| 136 | +<pre><code><dl> |
| 137 | + <dt lang="en-US">color</dt> |
| 138 | + <dt lang="en-GB">colour</dt> |
| 139 | + <dd>A sensation which (in humans) derives from the ability of |
| 140 | + the fine structure of the eye to distinguish three differently |
| 141 | + filtered analyses of a view.</dd> |
| 142 | +</dl></code></pre> |
| 143 | + |
| 144 | +<h3>With grouping division <code><div></code></h3> |
| 145 | +<dl> |
| 146 | + <div> |
| 147 | + <dt>Last modified time</dt> |
| 148 | + <dd>2004-12-23T23:33Z</dd> |
| 149 | + </div> |
| 150 | + <div> |
| 151 | + <dt>Recommended update interval</dt> |
| 152 | + <dd>60s</dd> |
| 153 | + </div> |
| 154 | + <div> |
| 155 | + <dt>Authors</dt> |
| 156 | + <dt>Editors</dt> |
| 157 | + <dd>Robert Rothman</dd> |
| 158 | + <dd>Daniel Jackson</dd> |
| 159 | + </div> |
| 160 | +</dl> |
| 161 | +<pre><code><dl> |
| 162 | + <div> |
| 163 | + <dt>Last modified time</dt> |
| 164 | + <dd>2004-12-23T23:33Z</dd> |
| 165 | + </div> |
| 166 | + <div> |
| 167 | + <dt>Recommended update interval</dt> |
| 168 | + <dd>60s</dd> |
| 169 | + </div> |
| 170 | + <div> |
| 171 | + <dt>Authors</dt> |
| 172 | + <dt>Editors</dt> |
| 173 | + <dd>Robert Rothman</dd> |
| 174 | + <dd>Daniel Jackson</dd> |
| 175 | + </div> |
| 176 | +</dl></code></pre> |
| 177 | + |
| 178 | +<h3>As glossary with term definition <code><dfn></code></h3> |
| 179 | +<dl> |
| 180 | + <dt><dfn>Apartment</dfn>, n.</dt> |
| 181 | + <dd>An execution context grouping one or more threads with one or |
| 182 | + more COM objects.</dd> |
| 183 | + <dt><dfn>Flat</dfn>, n.</dt> |
| 184 | + <dd>A deflated tire.</dd> |
| 185 | + <dt><dfn>Home</dfn>, n.</dt> |
| 186 | + <dd>The user's login directory.</dd> |
| 187 | +</dl> |
| 188 | +<pre><code><dl> |
| 189 | + <dt><dfn>Apartment</dfn>, n.</dt> |
| 190 | + <dd>An execution context grouping one or more threads with one or |
| 191 | + more COM objects.</dd> |
| 192 | + <dt><dfn>Flat</dfn>, n.</dt> |
| 193 | + <dd>A deflated tire.</dd> |
| 194 | + <dt><dfn>Home</dfn>, n.</dt> |
| 195 | + <dd>The user's login directory.</dd> |
| 196 | +</dl></code></pre> |
| 197 | + |
| 198 | +<h2>The <code>figure</code> and <code>figcaption</code> element</h2> |
| 199 | +<h3>Example with caption after the figurative grouped content</h3> |
| 200 | +<figure> |
| 201 | + <p>'Twas brillig, and the slithy toves<br> |
| 202 | + Did gyre and gimble in the wabe;<br> |
| 203 | + All mimsy were the borogoves,<br> |
| 204 | + And the mome raths outgrabe.</p> |
| 205 | + <figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption> |
| 206 | +</figure> |
| 207 | + |
| 208 | +<h3>Example with caption before the figurative grouped content</h3> |
| 209 | +<figure> |
| 210 | + <figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption> |
| 211 | + <p>'Twas brillig, and the slithy toves<br> |
| 212 | + Did gyre and gimble in the wabe;<br> |
| 213 | + All mimsy were the borogoves,<br> |
| 214 | + And the mome raths outgrabe.</p> |
| 215 | +</figure> |
| 216 | +<pre><code><figure> |
| 217 | + <p>...<p> |
| 218 | + <figcaption>...</figcaption> |
| 219 | +</figure></code></pre> |
| 220 | + |
| 221 | +<h2>The <code>search</code> element</h2> |
| 222 | +<search> |
| 223 | + <form action="#"> |
| 224 | + <label for="query">Find an article</label> |
| 225 | + <input id="query" name="q" type="search"> |
| 226 | + <button type="submit">Go!</button> |
| 227 | + </form> |
| 228 | +</search> |
| 229 | +<pre><code><search> |
| 230 | + <form> |
| 231 | + ... |
| 232 | + </form> |
| 233 | +</search></code></pre> |
| 234 | + |
| 235 | +<h2>The <code>div</code> element</h2> |
| 236 | +<h3>Multiple div's</h3> |
| 237 | +<div> |
| 238 | + <div> |
| 239 | + <div> |
| 240 | + <h4>This is a heading in a div element</h4> |
| 241 | + </div> |
| 242 | + <div> |
| 243 | + <p>This is some text in a div element.</p> |
| 244 | + </div> |
| 245 | + </div> |
| 246 | +</div> |
| 247 | +<pre><code><div> |
| 248 | + <div> |
| 249 | + <div> |
| 250 | + <h4>This is a heading in a div element</h4> |
| 251 | + </div> |
| 252 | + <div> |
| 253 | + <p>This is some text in a div element.</p> |
| 254 | + </div> |
| 255 | + </div> |
| 256 | +</div></code></pre> |
| 257 | + |
| 258 | +<h3>Empty div</h3> |
| 259 | +<div></div> |
| 260 | +<pre><code><div></div></code></pre> |
| 261 | + |
| 262 | +<h2>The <code>main</code> element</h2> |
| 263 | +<p>The current page leverages the <code><main></code> element.</p> |
| 264 | +<pre><code><body> |
| 265 | + <main> |
| 266 | + ... |
| 267 | + </main> |
| 268 | +</body></code></pre> |
0 commit comments