Skip to content

Instantly share code, notes, and snippets.

@adamkdean
Created February 26, 2014 10:03
Show Gist options
  • Save adamkdean/9226944 to your computer and use it in GitHub Desktop.
Save adamkdean/9226944 to your computer and use it in GitHub Desktop.
Dynamic widths with CSS
<!doctype html>
<html lang="en">
<head>
<style>
.container {
width: 80%;
}
.left {
float: left;
width: 300px;
background: blue;
}
.right {
float: left;
width: calc(100% - 300px);
background: red;
}
</style>
</head>
<body>
<div class="container">
<div class="left">
I am 300 pixels
</div>
<div class="right">
I am dynamic
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment