I have been in a few situations (very few) where I want a page to look different in Firefox. Here’s a little snippet of how you could code it. Please note that this CSS will not validate but will work perfectly fine.
/*"className" is your class or ID*/
/*FireFox 2 */
.className, x:-moz-any-link {font-weight:bold;}
/*FireFox 3*/
.className, x:-moz-any-link, x:default {font-weight:bold;}
Have you encountered any other hacks for firefox?
Update: Please note that you may have to write a hack for IE7

10 Comments
this code is not working!!! why give us a perfect solution otherwise pls dont waste others time. please it is a request. please
This code is not working for me either. The styles that are changed in the FF hack still show up in IE too.
This does not work. Why post this?
Try adding html>/**/body before your class/id name.
Ex.
html>/**/body .className, x:-moz-any-link, x:default {font-weight:bold;}
for ff3.
The first rule applies to FF2+ and IE7+. The second applies to FF3+ and IE7+. Therefore the post title is inaccurate (along with various other posts elsewhere).
Another useful hack I just spotted; FF2 on Windows is case-insensitive for attribute selectors (I’ve only tested with ID attribute). This allows rules that target FF2 and below only:
#rabbit[id=rabbit] { /* FF+ and IE7+ */ }
#rabbit[id=raBbit] { /* FF2 and below only */ }
Cheers, BJ
This was useful for me. Isolate the version of Firefox you want to with this hack and then correct it for IE7 using the usual conditional comment.
The FF2 hack worked for me fine.
Hi,
if you want only FF to do a special thing, use the lines above and after that an IE hack. To back it bold except FF:
/* All browsers */
.className, x:-moz-any-link {font-weight:normal;}
/*FireFox 2 and IE7 */
.className, x:-moz-any-link {font-weight:bold;}
/*FireFox 3 and IE7 */
.className, x:-moz-any-link, x:default {font-weight:bold;}
/* IE */
.className {_font-weight:normal; #font-weight:normal;}
Regards
Sorry, of course it must be
* All browsers */
.className {font-weight:normal;}
hello Jatin Meshiya email me at ssdf11@gmail.com i have a favor to ask you need some work done on my site please contact me
One Trackback
jmhjalzg…
jmhjalzg…