I've been thinking about how IDs are supposed to be unique in HTML documents, but often times that rule is not followed. I'm curious to know how browsers handle CSS applications when multiple elements share the same id.
From my initial testing, it seems like browsers apply the id-specific CSS rule to all elements with the same id. This behavior appears consistent across Internet Explorer 8, Chrome, Firefox, and Opera.
I wonder if this is a deliberate choice made by browsers to accommodate sloppy HTML or if there are exceptions to this behavior. What potential unintended consequences could arise in CSS layout as a result of multiple elements sharing the same id?