: Use p tag inside a div tag for text? What is better in terms of SEO ? <div class="box1" > <p> A bunch of text right here</p> </div> or <div class"box1" >
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 ?
More posts by @Speyer207
6 Comments
Sorted by latest first Latest Oldest Best
Absolutely no difference from SEO perspective. Both are same! The way SEO pages function is that they will give more priority to the tags such as h1, h2 ..etc. 'div's are just block level elements used for the HTMLisation purpose. It offers no contribution to SEO optimisation.
From the point of semantics , it is important to avoid such glitches that can hamper the processing of the DOM by the browser
No difference from SEO perspective. However, HTML semantics & performance should be taken into consideration. Unnecessary HTML tags also impact performance.
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 course, 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.
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.
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'.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.