How to ignore or hide a portion of a webpage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cartais
    New Member
    • Oct 2011
    • 1

    How to ignore or hide a portion of a webpage

    i am just beginning to learn html, and i am writing a page with notes in the page's text, like this:

    <a /*tag*/ href="/* the address of the desired page*/ "> text for the link here, or what is actually clicked on/displayed </a>

    i was told anything inside of /* */ is ignored by the computer entirely as if it were not there, but when i attempted this:

    <a /*tag*/ href="http://www.google.com
    /* the address of the desired page*/ "> text for the link here, or what is actually clicked on/displayed </a>

    it attempted to open the page and gave me the following message:

    The requested URL /*%20the%20addre ss%20of%20the%2 0desired%20page */ was not found on this server.

    how would i put "notes" into my code that i can reference but are not "read" by the computer? my desire is to have a completed and working link with a description of each element in the code beside what part it is describing but the descriptions are ignored by the computer when using the link, if that makes any sense
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Comments in HTML are indicated by
    Code:
    <!-- comment -->
    and cannot be inside other elements. What you show is typical of comments in C or Javascript programming languages only. Put your comments next to but not inside the elements as most people do.
    Code:
    <a href="http://google.com/">Hello</a> <!-- Comment -->

    Comment

    • cyberience
      New Member
      • Oct 2011
      • 2

      #3
      Yes as mentioned above <!--comment--> is the best way to hide code. but not the only one.
      I also use this method for data tags in the HTML, <!--tagname--> then do a replace of the <!--tagname--> with some data, code or other inline code, then I can keep the hTML as a template and in a complete structure.
      As I mentioned other methods to hide code, and be able to control it is to place the code inside <DIV> tags.
      <div style:visibilit y="hidden"> ..... </div>
      Then you can simply say visible. other tags can use this style directive, and you can have more than one, such as inline form to swap if a different form is required at the browser.
      Hope this helps.

      Comment

      Working...