Forum Moderators: open
body {
...
font-size:1.2em;
*font-size:0.9em;
}
The problem comes when I try to adjust Opera, which for some reason is displaying much larger type. I'm trying to use the "Be Nice to Opera" hack, but I must be doing something wrong, because FireFox is picking up on it and displaying type that is way too small:
body {
...
font-size:1.2em;
*font-size:0.9em;
voice-family: "\"}\"";
voice-family:inherit;
font-size:0.8em;
}
My questions: 1) Can anyone tell me if I'm goofing up the Be Nice to Opera hack? (I've never needed this one before.)
2) Is there any way anyone knows to show CSS code just to FF, i.e., analogous to the two other hacks above?
Thanks for any help you can provide!
PHP Example
<?php $useragent = $_SERVER['HTTP_USER_AGENT'];
if (eregi("Firefox/1.0", "$useragent")){echo 'Firefox Detected';?>
All you need to do is test the useragent string for the browser and version. Keep in mind that with Gecko browsers you should detect the revision number. For example I currently have an XHTML patch for Gecko 1.7 and older to enable overflow divisible elements to scroll.
Lastly keep in mind the order of how you serve your stylesheets is important.
Main StyleSheet First
Patch StyleSheet second
Anything after your main stylesheet will override your first "master" stylesheet and you'll only need to tweak your classes minimally in your patch CSS. I also use IECCSS for IE 5+ but am implementing this patching technique for MSIE 4. Hopefully you don't need to go that far back, I just like being leet. :-D
- John
firstly not really sure why you're trying to make font-sizes look the same.. using CSS you can only "suggest" a font size for a page especialy when using em's or %. The outcome will be based on the end users Browser preferences. If you are seeing different sizes in the different browsers you're testing in, check their defaults (most generally ship at 16px) whatever the default setting is will be = to 1em - You simply can't fix font size, you can only suggest, because you can't be sure what everyones preferences are.
1) Can anyone tell me if I'm goofing up the Be Nice to Opera hack? (I've never needed this one before.)
That's not the "Be Nice to Opera Hack" - It's the "Tantek Box Model Hack" (which used to include an advanced selector rule in order to 'be nice to Opera' because Opera6 didn't like it) it only works for IE5.x and is now generally regarded as being superceded by the much simpler Simplified Box Model Hack (or Tan Hack) - Box Model Hacks [css-discuss.incutio.com] - either way it's an IE Only Hack!
2) Is there any way anyone knows to show CSS code just to FF, i.e., analogous to the two other hacks above?
Suzy