CSS Hacks to Detect or Rule Out Firefox (Any Version)

These are my legal CSS Hacks for fixing web browser quirks or outright bugs. Please enjoy, I have been working on them for years. May it help you if you need them. Please read here first: [What are these CSS Hacks Anyway?] Then check my [Live CSS Hacks Test Page] and also [BrowserHacks.com] where I sent new hacks and test submissions for the site.

GENERAL DISCLAIMER – In case you haven’t read my other blogs, CSS hacks are just quickfixes to solve web browser problems for developers. It is always better to use good cross-browser CSS first, and use these as a last resort.

I worked with hundreds of different permutations and these are the best I have found for this purpose yet.

/* Firefox (All Versions) */

_:-moz-tree-row(hover), .selector { property:value; }

Another one I made a while back:

/* Firefox (All Versions) */

_:-moz-any-link, :root .selector { property:value; }

…And the reverse — Rule out Firefox:

/* (Anything but Firefox, and Internet Explorer 8-) */

_::selection, :root .selector { property:value; }

My previous [less ‘pretty’] version:

/* (Anything but Firefox, and Internet Explorer 8-) */

_::selection, .selector:not([attr*='']) { property:value; }

This ‘anything but’ hack is CSS3 based, hence the lack of support for Internet Explorer 8. Both of these I added to BrowserHacks.com.

IT Director/Senior Software Engineer, Photographer I test and create new CSS web page formatting hacks for BrowserHacks.com for the purpose of repairing web sites. PS-- CSS hacks are fun, but please attempt good CSS first unless in a bind.

Tagged with: , , , , , , , ,
Posted in Computers, Cool Code, CSS, CSS Hacks, Firefox, Firefox-All, Software, Tech, Web, Web Browser, Web Browsers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: