Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What is better in terms of SEO ?

<div class="box1" >
      <p> A bunch of text right here</p>
</div>

or

<div class"box1" >
A bunch of text right here
</div>

box1 div has a lot of css applied, so in order to make the text look like/where i want i will wrap it in that div . this div in particular only has text . But for SEO purposes is it better to use the p tag inside the div or just use the text directly in the div ?

The result is the same ( visually ).

PS: i understand that the general idea is that p is more relevant for seo than div ( or at least this is what i heard. please correct me if i am wrong here) . But in this case my text on this page will be shown in different containers on the screen for a better look. should i use the text inside the div or should i use the text inside the p tag and the p tag inside the div for better SEO ?

share|improve this question

5 Answers 5

Between two options, there is no difference for SEO. By the way, your question is not about SEO but it's about HTML semantic.

To respect the HTML semantic and unlike you think, the <p> tag exists for displaying paragraphs of text, not text. But in general, texts are displayed in a page through paragraphs. That's why you can use <p> tag inside a <div> HTML element but semantically, it's not an obligation.

Therefore, my answer to your question is: there is no difference for SEO, just use <p> inside a <div> element if your text is cut into paragraphs.

share|improve this answer
2  
your answered my question and i also learned something new. Thanks for helping a newbie :) –  ClawDuda Mar 31 at 13:44
2  
There is no difference for SEO or, to put it more cautiously, there is no known reason why the p markup would matter. The question was about SEO. There is no reason to raise the question about “semantics” here, and it would be a very misty topic; e.g., HTML5 has its own ideas of p, which might be seen as rather different from HTML 4 (and w3schools is about the worst place to consult in this matter, or others). –  Jukka K. Korpela Mar 31 at 14:36
1  
Please, use a better source for documentation: while w3schools is correct in this case, I'd be wary to share their links. I'd use this, from MDN: developer.mozilla.org/en-US/docs/Web/HTML/Element/p –  STT LCU Mar 31 at 14:39
1  
Ok guys, I changed the link to www.w3.org. –  Zistoloen Mar 31 at 14:43
1  
When w3schools gets it wrong, don't link to them. When w3schools gets it right, don't link to them. That's strange logic. –  Matt K Mar 31 at 20:21

First, I would take all those <p> is more relevant for SEO than <div> with a big grain of salt. SEO really only cares about content relevancy. Putting text in a <div> or in a <p> is not something you should be tweaking. Just go to what is the natural use.

<div> pretty much means 'this is a section of content' while <p> is 'this is a paragraph'. Personally, I just use <div> as it has no internal formatting in any browser, while <p> has some browser-specific formatting (margins, etc.) that can make things look different depending on the browser (unless you use a CSS 'cleaner'). Also, <p> inside <div> adds HTML which makes the pages a bit bigger, and thus, less pages would be crawled at once per crawler 'sweep'.

Worry about the content, not so much about how to write the HTML so search engines 'like it'.

share|improve this answer

To my knowledge it does matter, for a very simple reason:

A div is short for division, just a part/block on your website, where paragraph is designed for text. In something like a news article, a paragraph's first sentence is important(at least in Dutch language). It has vital information about what that paragraph is about (just think about it, every time you start a new sub-subject, you create a new paragraph where the first sentence is important).

I've been to a Google coarse, where the 'expert' told us about this principle and that Google that same trick (See, first sentence of new paragraph is important). With that in the back of you mind, it does differ if you use a div or p. Will it increase/decrease you pagerank by 8? No. But the devil is in the details.

Also, you get points for using sementic html. Using P's for paragraphs would help this principle.


In your example you miss the 3rd, and IMO the proper solution:

<p class="box1"> A bunch of text right here</p>

You remove the div and give the class to the paragraph. It does matter how you use your html. Unneeded elements will make the page slow(er), which affects PR.

share|improve this answer

No difference from SEO perspective. However, HTML semantics & performance should be taken into consideration. Unnecessary HTML tags also impact performance.

share|improve this answer
    
Please pay attention of posting an answer with additional information in relation to these already mentioned in other answers. –  Zistoloen Apr 3 at 11:08

Generally, SEO gives importance only for header tags (<h1>, <h2>, <h3>, <h4>, <h5> and <h6>). So no need to worry about <p> and <div> tags.

share|improve this answer
1  
I think you need to brush up you SEO knowledge, seems like you're throwing away a lot of (easy) points :) –  Martijn Apr 1 at 13:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.