|
12345678910111213141516171819202122232425 |
- title: Commentaire Hacker News sur Next Gen Static Blogging
- url: https://news.ycombinator.com/item?id=25701053
- hash_url: 6a8fadb032ab4c1951319268a1315655
-
- <span class="commtext c00">Note that closing </p> tags are optional<i>†</i>, so one can be an HTML purist and still write a decent HTML document with a relatively clean markup like this:<p></p><pre><code> <!DOCTYPE html>
- <html lang="en">
- <title>Lorem Ipsum</title>
- <h1>Lorem Ipsum</h1>
- <p>
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- Duis id maximus tortor. Sed nisi ante, fermentum vel nunc
- et, tincidunt sagittis magna. In ultrices commodo lacus, id
- tristique ipsum euismod laoreet.
- <p>
- Maecenas at neque posuere, aliquet erat at, vehicula est.
- Duis aliquet elit et arcu laoreet, id pulvinar eros pretium.
- Quisque consectetur, enim semper facilisis feugiat, velit
- sapien semper arcu, eu mollis libero est et odio.
- <p>
- Curabitur fringilla interdum ante vel ultricies. Mauris
- volutpat nisi sed turpis elementum elementum. Mauris nec
- eleifend lorem. Sed ac vulputate libero.
- </code></pre>
- A valid HTML5 document does not require<i>†</i> explicit <head>, <body>, or the closing </p>, </html> tags. See the spec for optional tags at <a href="https://html.spec.whatwg.org/multipage/syntax.html#optional-tags" rel="nofollow">https://html.spec.whatwg.org/multipage/syntax.html#optional-...</a> for more details. Similarly, the markup for lists and tables can be cleaned up too because the closing </li>, </tr>, </th>, </td> tags are optional<i>†</i>.<p>Note that the opening <html> tag is optional<i>†</i> too but I retained it in the above example to specify the lang attribute otherwise the W3 markup validator warns, "Consider adding a lang attribute to the html start tag to declare the language of this document."</p><p><i>† These tags are optional provided certain conditions are met. See the spec for full details. In practice, one rarely has to worry about these conditions.</i>
- </p>
|