WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Really Confused bout the HTML Comments on Mon Sep 05, 2011 7:23 am

Fragon


Registered Member
Registered Member
its says in w3 "comments can be inserted into the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed." ok i then tried myself and it wasn't there at all then whats the whole point in even adding this to your Code?!?! Please explain what it is used for,if no one can see them! -.-



Last edited by Fragon on Mon Sep 05, 2011 7:25 am; edited 1 time in total

2 Re: Really Confused bout the HTML Comments on Mon Sep 05, 2011 8:50 am

ankillien


Administrator
Administrator
Topic moved to HTML forum

While learning, HTML sounds very simple but while developing large sites and layouts, it is not that simple. You will have to deal with thousands of lines of code and dozens of <div> tags and <table> tags.

One is likely to get confused to find which tag was created for what purpose and which tag closes where. To avoid this confusion, developers use comments somewhat like this...

Code:
<html>
<head>
...
... some 20 lines of code ...
..
</head>
<body>

<div id="outer_wrapper">

  <div id="wrapper">

  <div class="left-column">
  ... 20-30 lines of code ...
  </div>
  <!-- left-column div ends -->

  <div class="right-column">
  ... 50-60 lines of code ...
  </div>
  <!-- right-column div ends -->

  <div class="footer">
  ... 10-20 lines of code ...
  </div>
  <!-- left-column div ends -->

  </div> <!-- wrapper div ends -->
</div> <!-- outer_wrapper div ends -->

</body>
</html>


Try studying the code without the comments and it will be difficult to find which tag closes where Wink

Comments are for developers of the web page and not for viewers. It for the purpose to add notes or references in the codes to make it well-managed and less confusing. Comments help the coders understand the code structure quickly.

Writers/readers add notes in their books, in the same way coders and developers add comments in their codes.

3 Re: Really Confused bout the HTML Comments on Mon Sep 05, 2011 6:34 pm

RockerMan


WebArtz Technician
WebArtz Technician
Very well explained Ani Smile


_________________


No support via. PM, as they will just be deleted
http://www.graphics-post.com/

4 Re: Really Confused bout the HTML Comments on Mon Sep 05, 2011 8:10 pm

ankillien


Administrator
Administrator
Thanks Rob.

5 Re: Really Confused bout the HTML Comments on Tue Sep 06, 2011 12:18 am

Fragon


Registered Member
Registered Member
Oh man,THANK you so much ankillien Very Happy very Helpful

6 Re: Really Confused bout the HTML Comments on Tue Sep 06, 2011 8:53 am

ankillien


Administrator
Administrator
Glad I could help Very Happy

Solved > Locked

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum