Link to home
Start Free TrialLog in
Avatar of cornell256
cornell256

asked on

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.
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

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?
Avatar of cornell256
cornell256

ASKER

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.

ASKER CERTIFIED SOLUTION
Avatar of gamebits
gamebits
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks - that makes sense.
Thanks for the points and the grade.

Gamebits