Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a grid layout with one static column and one responsive column?

I'm trying to create a two column layout with a fixed width column on the left, and a responsive column which takes up the remaining space on the right. Here's an example:

<div>
  <div style="width:120px"></div>
  <div></div>
</div>

I've been working on this for a while now, but I can't seem to get it to work. Help would be greatly appreciated. Thanks!

like image 660
user3130970 Avatar asked Dec 29 '25 16:12

user3130970


1 Answers

There is a simple solution using No TABLES and table styles with float and margin:

.sidebar { 
    width: 200px; 
    float: left; 
}
.content { 
    margin-left: 200px; 
}

Example: http://jsfiddle.net/NrFLf/

like image 99
Andrii Verbytskyi Avatar answered Dec 31 '25 09:12

Andrii Verbytskyi