<p> and <div> | Sololearn: Learn to code for FREE!


<p> and <div>

I am lil bit confused, when to use <div> which gives you the same output as <p>

10/6/2018 6:58:11 PM

Hari Arien

2 Answers

New Answer


<div> is for dividing an STRUCTURE into small sections. For example, if I'm looking to have a webpage with three sections, I might want to create three different <div>s, each one containing one section. <p> is for dividing a TEXT into small pieces, just like in grammar. So, if I was writing my answer as .HTML, each part of the explanation would be a different <p>. The more complex the website gets, the easier it is to see those differences.


hey martinho😀, thanks alot