FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[CSS] Height property in Internet Explorer





Stubru Freak
http://fvds.frih.net

I have set the height of the content div to 80%. Firefox renders this correctly*, but Internet Explorer doesn't make the div higher then the area needed for the text inside.

Is there a way of correcting this, preferrably without CSS hacks, and preferrably not just putting enough <br />s, because that would mean I'd had to change that amount of <br />s for every page I write, and also that people with other screen resolutions would have display problems.

Thanks,
Frederik Vanderstraeten


* by that I mean how I want it to render, not how it should render according to the w3c specs, altough I'm quite sure that's the same

____________________________________________________________


Update: I just found out it works with pixels, but not with percent values. I really need percent values as the div should adapt to the size of the screen.

Does anyone know a solution?

_____________________________________________________________


It works by adding the height of the body and html tags
eepman
Just use padding-top: 10%;
That will probably work.
Rhysige
I think IE has troubles with height and width being %'s but why set the height anyway? As ^ said use padding to get spaces top and bottom pading-top padding-bottom padding-left and padding-right
Stubru Freak
What will the padding solve? I want my div to always be the same size and get a scroll bar when the content is too big.

But I found the problem already, Internet Explorer only makes the body and html tags as big as needed for the containing text, which is correct I think. So you should explicitly set both the body and html tags to 100%.
cafefort
Hi folks Smile

On a project, I've had a white night (sleepless one) with this case!
And I just discoevered that IE can't do good calculations.
So If you have to give a height in %, you have at least to give it's parent
a height in pixels!

That was terrible! I've had to correct all the pages.

Anyway, IMHO, when you have a fixed layout, you'd better give each
element its dimensions in pixels using the standard notions and then write down some hacks for IE5-

I mean, don't code until you draw on a sheet of paper the layout with the
dimensions on it. When everything is fine in your head, go on: write css,
write good css first (css that works on firefox and respect W3Cstandards, not microsoft ones Wink ) and hack the css you've made
to suit MSIE.

Hope this helps Smile
Related topics
*OFFICIAL* Which Browser do you use?
Internet Explorer 7 sera mejor ?
[soft]Firefox más inseguro que IE
Internet Explorer 7 is coming!!!
problem with internet explorer
I don`t succeed to connect to FTP
[Solved] [Java] KeyListener Not Working In Internet Explorer
CSS: Internet Explorer and pseudo-class
What's New in Pocket Internet Explorer
Internet Explorer Glitch
CSS Positioning in Internet Explorer
Input Button's - Internet Explorer
No Table Badkground Image In Internet Explorer
Internet Explorer 10 Release Preview available for Windows 7
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.