By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,625 Members | 2,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,625 IT Pros & Developers. It's quick & easy.

Commenting /div tags?

P: n/a
Is there any good, clean, standard way to comment /div tags?
I usually use </div class="container", which works, but
doesn't pass validation.

</div<!-- end of container --also works, except under
certain conditions in certain MSIE versions, where it creates
a gap in the page for some reason.

Is there any formal or informal standard for this? Or is
needing to comment /div tags a sign that my page structure
is too complicated?
Feb 9 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In our last episode, <12*************@corp.supernews.com>, the lovely and
talented David Winfrey broadcast on comp.infosystems.www.authoring.html:
Is there any good, clean, standard way to comment /div tags?
I usually use </div class="container", which works, but
doesn't pass validation.
Well, yeah. It's nonsense. What in the world would a class
mean for an end tag?
></div<!-- end of container --also works, except under
certain conditions in certain MSIE versions, where it creates
a gap in the page for some reason.
Are you leaving the space between the </divand the comment?
It shouldn't matter, but many versions of IE are broken in this
way.
Is there any formal or informal standard for this? Or is
needing to comment /div tags a sign that my page structure
is too complicated?
--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 710 days to go.
Feb 9 '07 #2

P: n/a
On 9 Feb, 16:53, David Winfrey <nos...@nospam.patriot.netwrote:
Is there any good, clean, standard way to comment /div tags?
Use an editor that understands block structure.

If you're writing XML, use the editor's auto-format regularly. Get an
editor with formatting rules you can live with.
There is no point in adding "end of element" metadata to an XML
document, because the element is trivially (yet accurately) parseable
to achieve the same result. All that this duplication can possibly do
is give you one more thing to get out of synchronisation.

</div<!-- end of container -->
is _much_ worse than
</div>
if it's actually the end of the nav-bar element, owing to a surplus
tag further up the page.

Feb 9 '07 #3

P: n/a
Thanks for your answers.
Feb 9 '07 #4

P: n/a
In article <11*********************@v45g2000cwv.googlegroups. com>, Andy Dingley writes:
>On 9 Feb, 16:53, David Winfrey <nos...@nospam.patriot.netwrote:
>Is there any good, clean, standard way to comment /div tags?
>There is no point in adding "end of element" metadata to an XML
document, because the element is trivially (yet accurately) parseable
to achieve the same result. All that this duplication can possibly do
is give you one more thing to get out of synchronisation.

</div<!-- end of container -->
is _much_ worse than
</div>
if it's actually the end of the nav-bar element, owing to a surplus
tag further up the page.
However, if one regularly places a comment on each </divtag, stating
what DIV is being ended, then that's not going to happen, since they'll
always be able to see which <divand </divcorrespond.

--
Michael F. Stemper
#include <Standard_Disclaimer>
Indians scattered on dawn's highway bleeding;
Ghosts crowd the young child's fragile eggshell mind.

Feb 9 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.