How do I use figure and figcaption html tags?



  • figure and figcaption tags are semantic elements.

    Use for photos, diagrams, documents, and so on.

    <!DOCTYPE html>
    <html>
    <body>
    
    <h2>Lorem Ipsum</h2>
    
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
    
    <figure>
      <img src="https://via.placeholder.com/150" alt="Very grey">
      <figcaption>Fig.1 - Grey Box</figcaption>
    </figure>
    
    </body>
    </html>
    

    9f8280d6-891f-4dd9-926b-dd9594f4ac13-image.png


Log in to reply
 

© Lightnetics 2024