I am trying to display an HTML code on an HTML rendered page. Is there a tag that will let me do this?
do you mean show tags like <img>
without that they are rendered as html? you will need to use html entities
it is taught in the HTML Fundamentals part of the Certified Full Stack Developer curriculum https://www.freecodecamp.org/learn/full-stack-developer/
If you’re trying to display HTML code on a webpage without the browser rendering your code as actual elements, you’ll need to use special codes for certain symbols:
- Replace the
<
character with<
- Replace the
>
character with>
Here’s a complete list of all HTML character references:
Consider putting your code inside <code></code>
elements as well, for good semantics.
I’m doing the Build a Technical Documentation Page project, and I want to add an HTML code as an example to the paragraph but the tags I’m adding just behave as regular HTML tags even if they are in the <code>
element…
This is the code:
<p>CSS can be added to HTML documents in 3 ways:</p>
<ul>
<li>Inline, by using the <code>style</code> attribute inside HTML elements</li>
<li>Internal, by using a <code><style></code> element in the <code>head</code> section</li>
<li>External,by using a <code><link></code> element to link to an external CSS file</li>
</ul>
i want the <style>
tag and the <link>
to render to the page looking as an html tag
You want to look for HTML Entities, there is a video on it under HTML Fundamentals (under basic HTML)
THANK YOU SOOOOOO MUCH!!!
You’re welcome, :)