PDA

View Full Version : Comments in HTML question


Mr. X
Mon 27th May '02, 5:16am
I would like to put a small comment in my HTML code by using:

<!-- comment here -->

I would like it to appear a few lines below my Doctype line, but I am wondering if there is any specific place I need to put it. I didnt bother with commenting in my code before but now Im starting to see how useful it can be. Does it matter where I put it?

Dan615
Mon 27th May '02, 1:37pm
You can put a comment anywhere you want, except...


<!-- This is correct: -->
<!-- <a href="http://www.thehardwire.com" target="_blank"> -->


<!-- This is NOT correct: -->
<a href="http://www.thehardwire.com" <!-- target="_blank" -->>


That's the only rule I know of with HTML comments...

mister
Mon 27th May '02, 9:45pm
You also cannot nest comments



<!-- some multiple
line comments
go here

<!-- another comment -->

closing first comment -->



that will cause problems.

Dan615
Mon 27th May '02, 10:15pm
Oh yeah, that too :p