[thelist] DIVs with height not expanding vertically

Gunlaug Sørtun gunlaugs at c2i.net
Mon Mar 14 06:11:43 CST 2005


Ian Anderson wrote:
> Greetings all - lovely morning here in the UK

Looking good, but snowy, in Norway too.

> Wondered if anyone could offer any guidance with this; DIVs not 
> expanding vertically as the content grows if they have their height 
> set through CSS.

You are describing proper behavior for a good and standard-compliant
browser. Set height = absolute height-- anywhere but in IE/win.

> I imagine I should be using min-height to set the minimum height, but
>  this is not respected in IE. Most of my clients use IE.Argh!

Use min-height for the good browsers, and hide any height-definition
from them. Then, turn the page...

#something {min-height: 75px; _height: 75px;}

...and you've got the best from both worlds. Your clients will love it.

> (sorry to refer to previous winge, but tables don't pull this kind of
>  baloney.)

I love CSS-tables, but IE/win doesn't support them...
The old html ones are also great, for tabulating data.
----------------

> PS - I suddenly realised I can presumably use a collection of Obscure
>  CSS Hacks(tm) to deliver a height to IE and hide it from better 
> browsers; this is not a prospect that fills me with joy...

Always look on the bright side, or consider your own suggestion:

> Think I'll give up web design and go back to painting sheds; the 
> hours are better and the work is pretty much the same these days.

I prefer farming myself. Gets such intelligent answers when I feed the
cows with a particular problematic CSS issue. They never fails.

> Let's see, I need the IE Hole in Head fix, the Warsaw-Zackinsky 
> Parent Child Selector Dodge; but of course if...

No, you need the garbage-back-door-hack for IE/win. Comes in all flavors.
<!--[if IE]><shut-up /><![endif]-->
The other browsers will just laugh, and float by on some good CSS.
Works every time.

> Be nice to Opera? WHY CAN'T OPERA BE NICE TO ME FOR A CHANGE?

Oh, Opera loves a good stylesheet. It rarely ever gets one...
The strange thing is that IE/win, Gecko and Safari play along really
nice when Opera is satisfied. Maybe something to think about.

regards
	Georg
(farm-assistant and web-carpenter)
-- 
http://www.gunlaug.no


More information about the thelist mailing list