🎨 HTML / CSS
Beginner
What are semantic HTML elements? Give examples.
Answer
Semantic HTML elements are tags that convey meaning about the content they contain, both to the browser and to developers. Non-semantic elements like <div> and <span> say nothing about their content. Semantic elements provide context. Examples include <header> (top of a page or section), <nav> (navigation links), <main> (primary content), <article> (self-contained content), <section> (thematic grouping), <aside> (sidebar content), <footer> (bottom of page), <figure> and <figcaption> (media with caption), and <time>. They improve accessibility, SEO, and code readability.
Previous
What is the difference between HTML and HTML5?
Next
What is the DOCTYPE declaration and why is it needed?