Q1. What is the <div> tag used for?
The <div> tag defines a division or section in HTML, used as a container to group other elements for styling or layout.
Q2. Is <div> a block-level or inline element?
<div> is a block-level element, meaning it starts on a new line and takes full width.
Q3. How can you style multiple divs differently?
Use class or id attributes to target specific divs with CSS: <div class="header"> or <div id="main">.
Q4. What is the difference between <div> and semantic tags?
Semantic tags (<header>, <footer>) have meaning and describe content, while <div> is a generic container with no meaning.
Q5. Can you nest divs inside other divs?
Yes, divs can be nested to create complex layouts and hierarchical structures.
