Sunday, 25 August 2013

Is it a myth that id reuse in an html document is a w3c standard violation?

Is it a myth that id reuse in an html document is a w3c standard violation?

I was inspecting the way a certain webpage alternated between colors in
their divs and found this:
<div class="row8 inline clearfix" id="light-orange">...</div>
<div class="row8 inline clearfix" id="light-pink">...</div>
<div class="row8 inline clearfix" id="light-orange">...</div>
<div class="row8 inline clearfix" id="light-pink">...</div>
<div class="row8 inline clearfix" id="light-orange">...</div>
<div class="row8 inline clearfix" id="light-pink">...</div>
<div class="row8 inline clearfix" id="light-orange">...</div>
<div class="row8 inline clearfix" id="light-pink">...</div>
Thinking this was an example of html that wouldn't validate, I ran it
through the w3c validator (http://validator.w3.org/). It did have errors,
but none were regarding non-uniqueness of the ids. Everything I've read
has stated that ids must be unique within a webpage. What's the real story
here?

No comments:

Post a Comment