<section> Tag — HTML Technical Interview Questions & Answers
A generic standalone section of a document.
<section> Tag
- A generic standalone section of a document.
- <section> is the <section> HTML element. HTML uses this tag so the browser (and screen readers) know what the piece is, not only how it looks.
- Board: <section>…</section> Put it in body. Check it in the browser. Attributes go on the opening tag.
- Trap: wrong nesting or missing a required attribute. CSS can still style it — don’t pick a tag only because of default italics.
- Interview: name the tag, one attribute if it has a famous one (href, src, alt, for, type), one mistake.
Technical Interview Tip: <section>: the <section> HTML element. Example: <section>…</section>
Code Examples for <section> Tag
<section> Tag — working example
<header>
<nav aria-label="Primary"><a href="/">Home</a></nav>
</header>
<main>
<article>
<h1>Interview tip</h1>
<p>Prefer semantic tags over empty divs when meaning exists.</p>
</article>
<aside>
<p>Related: practice aloud for 30 seconds.</p>
</aside>
</main>
<footer>© GoCareerGo</footer><section> Tag — semantic tags describe meaning — better SEO/a11y than only div/span layout shells.
How to Explain <section> Tag to an Interviewer
What is the <section> tag?
the <section> HTML element <section>…</section>
One common mistake?
wrong nesting or missing a required attribute