JayT
JayT

Reputation: 11

HTML/CSS List issue

I am new to HTML/CSS coding. I am in the middle of a project for my summer class and I am stumped. Part of my project is to make a HTML list of three tags with the angle brackets included. I know how to add a tag using the angle brackets (< >) but I don't know how to add the tag into the list without the tag actually working. I need to find a way to add the tag into the list with brackets and not have the tag work so it can show up like this: My favorite tags are:

1.em

2.p

3.q

but with the brackets. Any ideas?

Upvotes: 0

Views: 51

Answers (3)

Code Different
Code Different

Reputation: 93151

You need to escape the tag characters. &lt; for < and &gt; for >.

HTML code:

<ol>
  <li>&lt;em&gt;</li>
  <li>&lt;p&gt;</li>
  <li>&lt;q&gt;</li>
</ol>

JSFiddle

Upvotes: 0

Marcus V. B. Siqueira
Marcus V. B. Siqueira

Reputation: 73

If i understood your problem what you need is to use HTML ENTITIES.

Here is a link with Full Explanation: http://www.w3schools.com/html/html_entities.asp

For "<" you have to use &lt; For ">" you have to use &gt;

Upvotes: 0

Andrew
Andrew

Reputation: 5083

You need to write the HTML-encoded versions of < and >, which are &lt; and &gt;.

Upvotes: 2

Related Questions