HTML & CSS · Junior · Question 53 of 75

What happens if you put a <div> inside a <p> in HTML?

<p>Intro <div>Block</div> text</p>

Explanation

<p> may only contain phrasing content. The browser ends the paragraph early, leaving an empty <p></p> at the end - a frequent source of styling surprises and hydration mismatches.

Further reading

Problem with a question

HTML & CSS · Junior · question 53

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz