Q1. What is the <p> tag used for in HTML?
The <p> tag defines a paragraph. It is a block-level element that automatically adds some margin before and after itself.
Q2. How can you create line breaks within a paragraph?
Use the <br> tag to create a line break within a paragraph without starting a new paragraph.
Q3. What happens if you don't close a <p> tag?
Browsers are forgiving and will often close it automatically, but it's not reliable. Always properly close paragraph tags.
Q4. How does the browser handle multiple spaces in paragraph text?
HTML collapses multiple spaces into a single space. Use for multiple spaces or pre-formatted text with <pre> tag.
Q5. Can you nest other elements inside a paragraph?
Yes, you can nest inline elements like <a>, <strong>, <em>, <span> inside a paragraph, but not block-level elements like <div>.
