<p> Inception - HTML

Viewed 79

In my HTML project, I am trying to mention the <p> tag. However, VS Code is interpreting it as an actual <p> tag and it causes weird things to happen. Does anybody have a way to get around this? Thank you in advance!

3 Answers

Use &lt; in place of < and &gt; in place of >.

Bytheway, it is common to style code snippets with the code tag.

<code>&lt;p&gt;</code>

And if you ever need a multiline code snippet, wrap it in a pre tag to preserve whitespace.

<pre><code>&lt;p&gt;
    this stays indented and the newlines where added without a br tag
&lt;/p&gt;
</code></pre>

You need to use HTML character entities for greater than & less than signs. Try

&gt;p&lt;

Use them between <xmp></xmp> tag. Code:

<xmp><p></p></xmp>

Output:

<p></p>
Related