开发者

id="toptips" and id="topTips" are both valid in same page?

开发者 https://www.devze.com 2023-01-31 01:12 出处:网络
I\'m using two css id with same name in same page but with a difference in capitalization of one letter.

I'm using two css id with same name in same page but with a difference in capitalization of one letter.

<div id="toptips"> </div>

and

<div id="topTips"> </div>

I'm using a firefox plugin to check validation called "HTML VALIDATOR"

http://users开发者_运维百科.skynet.be/mgueury/mozilla/

And it's giving error for duplicate id. but when I checked in http://validator.w3.org/#validate_by_input+with_options it doesn't showing any error.

Is the Firefox plugin wrong in this case?


Technically, an id is case sensitive, so the plugin is wrong.

However, I wouldn't trust browsers to honor the case sensitivity.

Note that last time I looked at that plugin, it defaulted to using HTML Tidy (which is not a validator) and not OpenSP (which is).


The id attribute is case-sensitive, so it is legal to have both.

0

精彩评论

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