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>
© Lightnetics 2024