Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ellenbo/0e48977df17d7cc93c4a to your computer and use it in GitHub Desktop.
Save ellenbo/0e48977df17d7cc93c4a to your computer and use it in GitHub Desktop.
2 column div layout: right column with fixed width, left fluid
.container {
height: auto;
overflow: hidden;
}
.right {
width: 180px;
float: right;
background: #aafed6;
}
.left {
float: none; /* not needed, just for clarification */
background: #e8f6fe;
/* the next props are meant to keep this block independent from the other floated one */
width: auto;
overflow: hidden;
}
Description:
How to create a two column div layout where one column is a fixed width and the other is responsive.
Source:
Stackoverflow
http://stackoverflow.com/questions/5195836/2-column-div-layout-right-column-with-fixed-width-left-fluid
<div class="container">
<div class="right">
right content fixed width
</div>
<div class="left">
left content flexible width
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment