Should I use a <p> tag or a <div> tag?



I notice I can use either <div> or <p> elements in the workspace and the paragraphs seems to display exactly the same. Since it doesn’t seem to matter much one way or another, which element should I use here and why?


This is a great discovery as it illustrates that <div> and <p> elements have something in common: they are both block level elements. As such, the browser renders these elements in the same way. It is up to the developer to pick the tag which best describes the content it will contain. When we are dealing with paragraphs, the semantically correct tag to pick would be the <p> tag.

As you press on with your learning, keep on experimenting in the workspace!

FAQ: Learn HTML Elements - Intro to HTML - Review