Styling SharePoint with Attribute Selectors and IE6

I recently posted some methods for styling SharePoint web parts using attribute selectors. I heard back from several people about how they can’t use this option due to IE6’s lack of support for attribute selectors. I was aware of this at the time of the post but neglected to point it out in the post text.

IE6 usage is steadily dwindling (Jan ’09 – 18.5% browser market share; source: W3). I know there is also internal use of IE6 throughout organizations, but this is also slowly receding.

CSS is usually about form, not necessarily about function.  I encourage people to focus on the most common denominator and not the least common denominator when testing and styling web pages for browser support. If attribute selectors or any other type of method works for the mass majority of your users, then use it.   Don’t make development harder and more time intensive for the sake of a smaller percentage of users. Having your web pages downgrade gracefully does not mean the web page has to look exactly the same in every browser.  You do have to decide what must match visually across all browsers, but ultimately the focus is displaying the content and not what color the text is, etc.

You can also use conditional comments in IE to provide JavaScript or CSS files that are targeted for IE, or even a specific IE version.  Learn more about conditional comments here. This method can be used in workarounds and styling differences or even providing a simpler interface for IE6 users.

There are a few posted workarounds for attribute selectors and IE6:
Simulating Attributes Selectors in IE6
CSS + Javascript Workaround for Styling Form Inputs in Internet Explorer (IE)

One last comment before the angry mob hits, I understand that there are situations out there where you have to support IE6. They are the mass majority of users for your site, etc.  Attribute selectors aren’t the only solution, just an option.  Meanwhile, keep encouraging those sites/projects/people to leave analog and join the digital age before we toss their computer monitors out.  😉

One thought on “Styling SharePoint with Attribute Selectors and IE6”

Comments are closed.