Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS display: table min-height not working

Tags:

css

Does anyone know I can make min-height work with the latest browsers? I am using CSS tables and it seems to ignore min-height.

<div style="background-color: red; display: table; min-height: 100px;"> abc </div> 

Fiddle

like image 754
Samantha J T Star Avatar asked Oct 17 '11 06:10

Samantha J T Star


2 Answers

When using tables, height essentially is min-height, as tables always stretch. Just get rid of the "min-" and it will work as you expect.

like image 180
swider Avatar answered Oct 18 '22 21:10

swider


Use height: 1px; on the table or any value. Basically you need to give table some height to make it work with min-height. Having only min-height won't work on tables on firefox.

like image 26
virajs0ni Avatar answered Oct 18 '22 21:10

virajs0ni