• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 811
  • Last Modified:

HTML code using < and > does not seem to work

I have some code to put into my html page via Dreamweaver.  For this question, I will present a comment line.

The code was given to me with entities &gt and &lt instead of > and <.

First off, I saw that semi-colons were absent.  So I added ; to each &gt and &lt.  Still does not work as described next.

I am supposed to use the first line below, but it does not work.  It does not become a comment.  In the second line, when I replace the entities with < and >, the line is commented out, that is, it works.

Does not work ----->    &lt;!-- entities test --&gt;

Works ----->               <!-- regular test -->

Two questions.  First, why are the entities used instead of < and >.
Second, what is wrong with the line that does not work.
0
cornell256
Asked:
cornell256
  • 2
  • 2
1 Solution
 
Ryan ChongCommented:
to comment in HTML we need to use <!-- and end with -->

Just try enter this comments in the Code Portion, instead of Design Portion in your Dreamweaver?
0
 
cornell256Author Commented:
Thanks for the reply.  As stated above, it works with the <!-- and -->
That is a comment, fine.

I need to make it work with the XML entities, or understand why that won't work.  It should work fine.

I am using the Code portion of Dreamweaver.

0
 
gamebitsCommented:
You use entities on a webpage when you want to show a piece of code or when you want to display the entities, the browser will not "read" the tag it will just display it.

Gamebits
0
 
cornell256Author Commented:
Thanks - that makes sense.
0
 
gamebitsCommented:
Thanks for the points and the grade.

Gamebits
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now