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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
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.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cornell256Author Commented:
Thanks - that makes sense.
Thanks for the points and the grade.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.