CSS specificity for deprecated HTML attributes

Today I had to plug a slightly strange gap in my knowledge – how old school HTML attributes apply to the CSS specificity resolution for conflicts. An example would be the border attribute specified both as an attribute on a table element, and with an element selector in a stylesheet.

It looks like old school html attributes to control presentation are treated as the lowest of the low – so a duplicate instruction within any kind of CSS selector will be treated as more specific and win.

I had at first assumed they would be treated with the same specificity as inline styles, but not so.

Now you can sleep at night.

Posted:

November 23, 2009 @ 16:40

Categories:

Development

Tags:

Comments:

No comments so far

Comments RSS feed for comments on this post.

No comments yet.

Leave a comment