Can you use the id attribute in the closing of a div tag?
hi
2008-07-18 21:16:44 UTC
for instance can i put
blahblah
to help me reference for myself
Five answers:
Salman A
2008-07-18 21:28:44 UTC
That'd be a violation of HTML rules. w3 validator will complain something like: name start character invalid: only S separators and TAGC allowed here.
Use HTML comments. Thats what they are for:
blahblah
PhpMyCoder
2008-07-19 04:20:17 UTC
No all you need to do is:
Container Text and Content
There is no need for you to put it in the closing DIV tag.
anonymous
2008-07-19 04:30:06 UTC
It's considered bad programming style, but it shouldn't hurt anything with your web page. If you just want to use it for your own reference, knock yourself out. But you may want to consider indenting your code so that each block is easy to pick out on its own. Also, the above way of putting an id in your closing tags may violate XHTML standards, if that's something you care about.
mnmboy
2008-07-19 05:17:20 UTC
Salman's advice is spot-on, mate. Standards compliance aside, just knowing you can do it doesn't mean that you should: why would you knowingly force a browser to read your webpage in quirks mode? As he stated, that is what HTML comment markers are used for.
Chennu
2008-07-19 04:30:08 UTC
You may use .but of no use even if u use no problem
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.