Html "Already defined" Error
I am debugging a layout right now and have come across some strange errors. and I am serving the page up as DTD XHTML 1.0 Strict.
The error shows is like this
ID "OFFICENAME" already defined:
div class="office" id="officename"
ID "OFFICENAME" first defined here
span开发者_C百科 id="officename">
and
- NET-enabling start-tag requires SHORTTAG YES
This error is showing in the break code
<br />
Please any one help me out of this and tell me the correct way of representing
id
must be unique. You can't have two elements with the same ID. You should remove one of theid
s or useclass
instead. You can have multiple classes on any given element, e.g.:class="office officename"
In HTML/SGML meaning of
/
is different than in XHTML:<foo/bar/
is<foo>bar</foo>
and<foo/>
is<foo></foo>>
(that's an archaic quirk supported only by W3C validator).
You're probably sending XHTML markup as HTML. Usetext/html
MIME type with HTML5 DOCTYPE instead (you'll get better compatiblity, better validation and/>
talismans will be allowed).<!DOCTYPE html>
You can't have multiple elements with the same id. Change the id on the span or the div to something else.
精彩评论