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

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]

1Really Confused bout the HTML Comments Empty Really Confused bout the HTML Comments Mon Sep 05, 2011 8:53 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 8:55 am; edited 1 time in total

2Really Confused bout the HTML Comments Empty Re: Really Confused bout the HTML Comments Mon Sep 05, 2011 10:20 am

ankillien

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.

RockerMan

RockerMan
Technician
Technician
Very well explained Ani Smile

http://www.graphics-post.com/

ankillien

ankillien
Administrator
Administrator
Thanks Rob.

Fragon


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

6Really Confused bout the HTML Comments Empty Re: Really Confused bout the HTML Comments Tue Sep 06, 2011 10:23 am

ankillien

ankillien
Administrator
Administrator
Glad I could help Very Happy

Solved > Locked

Sponsored content


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