HTML code using < and > does not seem to work

Posted on 2006-04-08
Last Modified: 2008-03-10
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.
Question by:cornell256
    LVL 48

    Expert Comment

    by:Ryan Chong
    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?

    Author Comment

    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.

    LVL 28

    Accepted Solution

    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.


    Author Comment

    Thanks - that makes sense.
    LVL 28

    Expert Comment

    Thanks for the points and the grade.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now