Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With CSS should I use p tag to wrap text or will div suffice?

Tags:

html

css

As the title says, would it be better to wrap text using <div> or using <p>. Which would work better for SEO?

like image 365
kenshee Avatar asked Jun 07 '10 07:06

kenshee


1 Answers

Semantically you should always use <p> to hold any "content" text within the body of your page. Similarly, headings should always go in <h1>, <h2> etc. Only use <div> for layout and positioning purposes (so for example as a wrapper around the main body of content, sidebars etc).

Search engines will typically rank pages using semantic HTML higher in their results as pages laid out in this way are more "machine-readable".

like image 132
Matt Weldon Avatar answered Sep 28 '22 17:09

Matt Weldon