iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register

Go Back   WebForumz.com > Resources > Tips & Tricks > (X)HTML & CSS
Register All Albums Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

Author


Jack Franklin
Jack is 15 years old and lives happily in Cornwall, England. Web Design is his passion and he works using xHTML, CSS and PHP to code his websites, with the odd bit of Javascript now and then. In his spare time, Jack enjoys playing Football, rugby, tennis and snooker (but not all at the same time).

RSS Feed

Your Options
Organise your HTML with Comments

Prevent your code from becoming confusing by using HTML comments.

With lots of different <div> tags in a page, it can be confusing when looking at your HTML code. Which div starts where, and where does it end? Often, you end up with something similar to:

 <div id="wrapper">
<div id="nav">
<div id="main">
</div>
</div>
<div>

But how do you know, easily, which one is the wrapper, which one is the navigation, and which one is the footer? By using html comments. The syntax is:

<!--html comment in here-->

So you might have:

<div id="wrapper"><!--start of wrapper div-->
<div id="nav"><!--start of navigation div-->
navigation stuff
</div><!--end of navigation div-->
<div id="main"><!--start of main content div-->
main content
</div><!--end of main content div-->

</div><!--end of wrapper div-->

That way, with just a quick skim through your HTML, you can see where one <div> starts and ends, without spending ages and end up getting confused!


Related Resources

Members's Comments No Comments. Be the first to comment on and rate this resource.


Search Engine Optimization by vBSEO 3.2.0 RC8