the min-height bug

the newly released theme’s (read previous entry) tableless css layout has a bug. the layout doesn’t look the same under MSIE and Mozilla. The problem would be very easy to solve if i were to use a table. all i will have to do is set the height=”750″ in the table defintion. then if the content in the table is not long enough, it fills the rest of empty space. and if the content is too long, it stretches the table’s height. this maintains the minimum height of the table at 750px. we also take it for granted that this behavior is supported by all browsers. to accomplish the same task with pure css becomes a bit more interesting and esp. when you also want it to be supported by “all browsers” (meaning MSIE, mozilla & opera) ^_^ if you are interested in knowing how to do that in tableless css, read on.

the problem in css is caused by the fact MSIE does not support min-height. Its height property works like min-height in mozilla and opera.

in my case, if i were to put
min-height: 750px;
height: 750px;

in my class definition. under mozilla you will see this
 
this is because the height definition overwrites min-height. If the height is set, the area will not stretch itself when it overflows.

however if i were to take away height property and use only
min-height: 750px;
everything will work fine under mozilla but in MSIE, you will see this
 

because it does not understand min-height property, it will only stretch the height up to necessary. i want it to have a certain height so the sidebar does not over run the main content.

by searching google, i found this pixy’s min-height hack. after i applied the hack, the situation is solved. now both of my domain index page and my main blog page should look fine under both MSIE and mozilla :) That hack is very cool!


7 Comments Leave a Comment

Rita [ Quote ]

The theme looks good in my browser. :) I love it, great work.

November 11th, 2003 at 6:27 pm
Cyn [ Quote ]

This is a neat layout u have here. I wish I could understand ccs better.

November 11th, 2003 at 6:32 pm
Miki [ Quote ]

Gorgeous. :) I love this sort of style. Well done, dodo!

November 11th, 2003 at 6:39 pm
nikkiana [ Quote ]

That’s pretty cool. :) I love the new layout too. :D

November 11th, 2003 at 6:40 pm
Stacey [ Quote ]

Wow, I think that was the same problem I was having with my tabulas layout. Thanks for the link

And great new theme too :)

November 12th, 2003 at 10:24 am
ecila [ Quote ]

wow! great find on that min-height hack! =)

November 13th, 2003 at 7:37 pm
nadine [ Quote ]

i love it. the design is just so streamline and smooth looking!…….. the min-height hack is awesome too!

November 14th, 2003 at 1:02 am

Leave a Comment Name, email and comment are required.
Email will never be displayed.

Leave a Comment
  1. :biggrin: :blank: :blush: :bored: :confused: :cool: :down: :evil: :frown: :grin: :grr: :laidback: :left: :mad: :right: :sad: :secret: :shock: :smile: :stress: :tongue: :up: :wink: :yawn: :cute: :dead: :film: :floppy: :glasses: :grumpy: :headphones: :heart: :lightbulb: :ouch: :tv: :upsidedown: :vodka: :yell: :yuck: :yummy: