On Oct 22, 2009, at 8:33 PM, G. Sørtun wrote:

> Hugh Guiney wrote:
>> http://www.nospoon.tv/test/bgcolor.html.
>>
>> I have tried this in Firefox 3.5.3 and Chrome 3.0.195.27 on Windows
>> XP and the result is the same. Oddly enough, IE7 renders them exactly
>> the opposite. So, barring that, how do I get the first example to
>> render the same as the second in 2.1 without using the same code?
>
> You can try using two decimals for those em values, but because  
> browsers
> have different "tip-over points/values" when calculating ems into  
> pixels
> for rendering on screens you'll have a hard time finding values  
> they'll
> all agree on at different font sizes.

To make matters more complicated, browsers round values differently  
when computing padding & border. Borders (at least in WebKit and  
Gecko)  are always rounded off to the nearest pixel - amongst other  
reasons to avoid giving the impression of ' blurred' borders when the  
border-width computes to something else than an integer.
>
> The safest is to stick to your first example only, but declare the
> paddings and border-width in px on both states. All browsers will  
> agree
> on that, no matter which other border styles they pick up or not.

That is the easiest & most cross browser friendly solution. Instead of  
rgba(0,0,0,0) in example 2, you could also use the 'transparent'  
keyword. That would cover IE8 and 7 (iirc, I think IE 6 doesn't  
support 'transparent' for borders)

Philippe
---
Philippe Wittenbergh
http://l-c-n.com/





______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to