4 replies [Last post]
mauricio.bonetti
Offline
newbie
Last seen: 13 years 17 weeks ago
Joined: 2009-02-27
Posts: 7
Points: 0

On my way creating a web page I faced the following problem:

on writting:

this markup works fine on firefox, but on ie6 the div's height became 20px.

I've tried line-height:10px .... min-height .... max-height ... but it was workless.

I am not allowed to use hack's, I really need a "by the book" solution.

Thanks in advance!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 4 years 51 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

have you tried clearing all

have you tried clearing all margin and padding?

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 6 years 43 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

if you're looking for

if you're looking for by-the-book, inline styles are not printed in that book. use this.

<div id="redDiv">content</div>

DIV#redDiv {height: 10px; background: red;}

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

An empty div is meaningless,

An empty div is meaningless, what is it's purpose? What is it going to hold?

We ask that people provide enough detail for answers to be arrived at, that detail is lacking in your snippet.

IE will reserve enough height for the font size that element has inherited therefore try zeroing the font-size or make font size equal the required height, and tell us if that produces the desired result.

If you are trying this without a fully realised document i.e one that has a DTD please place one in the nmarkup before proceeding much further.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

mauricio.bonetti
Offline
newbie
Last seen: 13 years 17 weeks ago
Joined: 2009-02-27
Posts: 7
Points: 0

I've tryed changing the

I've tryed changing the font-size to 1px and it fixed the bug.
But what's up?
What does font-size has to do with div's height ?

It appers nonsense to me.

Anyway, thanks a lot, you saved my weekend !!