Hi,
I would not try to use the hack on top property but rather on the
height property since that is what is causing the problem. IE reads
the height placing the padding-top outside of the box and FF takes it
inside the box, like it should be according to W3C box model.

Either use IE Conditionals and add a IE specific css file (which will
only be read by IE), which is placed after your general css file.
Example:
<!--[if lte IE 7]>
<link media="screen" rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->

in ie.css
#menubar div {
    height:20px;
}

or you use the boxmodel hack you suggested above on the height attribute:
http://css-discuss.incutio.com/?page=BoxModelHack

Take a note though that:
height : /* */ 300px;

will be parsed by IE 7 and so NOT work anymore as intended, just like
some other hacks that will be fixed IE 7.

regards, Jens

On 10/9/06, Alexandru E. Ungur <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a problem trying to setup a div so that it show the same (size) in IE
> and FF/Opera/etc. The problem is kind of classic: if I set padding in the
> example below, in FF will be added to the height of the div, making it
> taller than I want it to be, while in IE it won't. Last time I played with
> CSS (about 2-3 years ago) I solved this by using a trick[1] that allowed me
> to specify different settings for IE and FF. However that trick seems to no
> longer work. I wonder how is this problem handled these days... how can I
> have the same size (and padding) in both IE and FF ?
>
> Here's the relevant CSS:
>
> #menubar div {
>   position:absolute;
>   display:block;
>   background: url(menu-button.gif);
>   width:114px;
>   height:25px;
>   top:0px;
>   padding-top:5px;
> }
>
> And there the trick:
> [1]
> top:160px;
> top /* */:/**/160px;
> top /**/:150px;
>
>
> Thank you in advance,
> and have a nice day everyone.
> Alex
> ______________________________________________________________________
> css-discuss [EMAIL PROTECTED]
> http://www.css-discuss.org/mailman/listinfo/css-d
> IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>


-- 
So long and thanks for all the fish.
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to