How do I use the details and summary html tags?



  • The details and summary html tags are semantic elements. The details tag is used for open and close information on demand. The summary tag is a short description of what the details are.

    <!DOCTYPE html>
    <html>
    <body>
    
    <h1>Lorem Ipsum</h1>
    
    <details>
      <summary>Find more details.</summary>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
    </details>
    
    </body>
    </html>
    

    d298a2f6-8153-4295-b323-97f4ed1a90e2-image.png

    Clicking the summary shows the details.

    11ffa32b-e262-41cc-9638-0610da35d35e-image.png


Log in to reply
 

© Lightnetics 2024