How do I use the article html tag?



  • Also see: How do I use the section html tag?

    The article tag is a semantic element.

    This looks similar to the section html tag however, it is used for self-contained content, it can be used with the section tag.

    <!DOCTYPE html>
    <html>
    <body>
    
    <article>
      <h1>Heading One</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Morbi quis commodo odio aenean sed adipiscing diam donec.</p>
    </article>
    
    <article>
      <h1>Heading Two</h1>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Fermentum iaculis eu non diam phasellus vestibulum.</p>
    </article>
    
    </body>
    </html>
    

    The output looks the same as the section output and is not shown here.


Log in to reply
 

© Lightnetics 2024