Hacker News new | past | comments | ask | show | jobs | submit login

>This isn't enforced by browsers. They will happily render all elements with the same ID and apply the same styles to all of them.

We live in post-xhtml times, browsers will try to make sense and render all sorts of bad code.

>If you accidentally put the logo twice on the page, it will be clearly visible. It virtually never happens and when it does it isn't hard to track down.

You're assuming the visual difference in applied style is always clearly visible, like a repeated logo. No, it's often not, not until someone changes something in a class and the change is populated everywhere the class was reused. An ID is a guarantee it was not reused, or at the very least serves as a "do not reuse" sign.

Edit: formatting




Right, so what's the problem if it looks fine?

The only problem is that you used an ID.

>"do not reuse"

Why not? If someone wants to reuse something, they probably have a good reason. Why would you get in their way? You won't gain anything from doing that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: