【问题标题】:How to insert this text: "<p>Coder and developer</p>" inside an HTML <p></p> tag? [duplicate]如何在 HTML <p></p> 标记内插入此文本:“<p>Coder and developer</p>”? [复制]
【发布时间】:2020-01-24 10:44:48
【问题描述】:

我刚从 HTML 和 CSS 开始,我有一个可能很愚蠢的问题,但我还没有找到答案。

假设我想在我的网站上展示这个:

<p>Coder and developer</p>

就这么简单,但是当我在&lt;p&gt; 标记内写它时,它会识别出我想用作文本的另一个&lt;p&gt; 标记。

可能解决方案非常简单,但我还没有像我说的那样找到它。

【问题讨论】:

标签: html css text tags paragraph


【解决方案1】:

你可以使用&lt;pre&gt; &lt;/pre&gt;标签来完成这种方式:

&lt;pre&gt;&amp;lt;p&amp;gt;Coder and developer&amp;lt;/p&amp;gt;&lt;/pre&gt;

【讨论】:

    【解决方案2】:

    您不能在另一个 p 标签之间添加“p”标签。 HTML 无法解析它。

    如果要创建上述模板,请使用“div”,然后在其中插入“p”标签。

    【讨论】:

      猜你喜欢
      • 2017-08-06
      • 2011-06-08
      • 1970-01-01
      • 2015-08-20
      • 2014-12-18
      • 2010-10-29
      • 1970-01-01
      • 2019-11-26
      • 1970-01-01
      相关资源
      最近更新 更多