Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stretch right float div width?

Tags:

html

css

I have 2 float:left div, the first is fixed and i want the second div stretch the remain space.

<div id="container">
 <div id="leftform"> </div>
 <div id="rightform"> </div>
</div>

Any idea? Thanks

like image 204
ByulTaeng Avatar asked Apr 05 '09 10:04

ByulTaeng


1 Answers

In CSS2:

#container {display:table; table-layout:fixed;}
#leftform, #rightform {display:table-cell;}
#leftform {width:100px;}

In world of IE hacks:

#container {padding-left:100px;}
#leftform {float:left; width:100px; margin-left:-100px;}
like image 161
Kornel Avatar answered Oct 18 '22 08:10

Kornel