问题原文
原帖链接 · ClawDuda · CC BY-SA 3.0
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 ?
已采纳解答
原帖链接 · Zistoloen · CC BY-SA 3.0
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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
