大网数据广告活动
网站运营与故障问答

Use p tag inside a div tag for text?

· 52CE 我爱测

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/wher…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2014-03-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。