开发者

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

  1. ID "OFFICENAME" already defined:

    div class="office" id="officename"

  2. ID "OFFICENAME" first defined here

    span开发者_C百科 id="officename">

and

  1. 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


  1. id must be unique. You can't have two elements with the same ID. You should remove one of the ids or use class instead. You can have multiple classes on any given element, e.g.:

    class="office officename"
    
  2. In HTML/SGML meaning of / is different than in XHTML: <foo/bar/ is <foo>bar</foo> and <foo/> is <foo></foo>&gt; (that's an archaic quirk supported only by W3C validator).
    You're probably sending XHTML markup as HTML. Use text/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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜