Q1. What is the <span> tag used for?
The <span> tag is an inline container used to group inline-elements for styling purposes with CSS or manipulation with JavaScript.
Q2. What is the difference between <div> and <span>?
<div> is block-level, creates line breaks, and groups larger sections. <span> is inline and groups text portions without line breaks.
Q3. Can you apply CSS to a <span> element?
Yes, <span> can be styled with CSS using class or id attributes to change color, font, background, etc.
Q4. What is the default display property of <span>?
The default display property of <span> is inline, meaning it flows with text and doesn't start a new line.
Q5. Give an example of using <span> for text styling.
Example: <p>This is <span style="color:red">red text</span> in a paragraph.</p>
