Why are p (paragraph) elements not used in HTML?« Back to Questions List

Short answer, <p/> elements are not needed - a <div/> will have the same outcome!

Long answer, <p/> elements have a specific purpose in HTML which is to render content with preformatted margins and padding. On one hand if these were universal values used by all browsers and devices - then it might work well. In reality each browser and device sets its own margin and padding for virtually every element. This is the reason for CSS reset - if you have heard of it.

Secondly, search engines do not parse <p/> elements in a special way. There are some elements which search engines add weights to such as headings (<h1/>, <h2/>, etc.) and sectional content (<header/>, <section/> and <footer/>), and a few more; but <p/> elements are treated the same as a <div/> with text - no difference in search results.

Lastly, using <p/> is discouraged because you ARE the design! When you draw content in Photoshop, you are adding the positions and size already. If we output a <p/> with your text, then override the margins, and padding to force the positions and size from Photoshop - then its no longer a <p/> element - its a container - which in HTML is a <div/>.

Redundant is it not?

I don't care, I want to add it anyways

There are 2 ways to do this, you can (a) use ${class} tag and manually convert a folder to a <p/> element - or (b) use ${code} tag and warp your text contents, eg. <p>Your text... </p> - do this inside your text layer.

Added August 14, 2015 2:06 pm

Do you have the right answer? If you do other users will benefit from your contribution, share your knowledge with the community!

0 answers
Last Answered 7 years ago by admin

Recent Answers

asked by samiteam
asked by PixelForce
asked by zipsoft
[+] View All Recent Questions

Share Your Knowledge!

Contribute to the community and help other users to benefit from your answer with experience and knowledge.