Skip to content

Instantly share code, notes, and snippets.

@adaam2
Created June 27, 2014 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adaam2/13f6c8a2c4b25824b4a4 to your computer and use it in GitHub Desktop.
Save adaam2/13f6c8a2c4b25824b4a4 to your computer and use it in GitHub Desktop.
Dynamically sized horizontal lists - expanding widths
div.wrap {
display:table;
width:100%;
}
ul {
list-style:none;
display:table-row;
}
li {
display:table-cell;
width:auto;
white-space:nowrap;
border:1px solid #e2e2e2;
background:#fff;
padding:1em;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div class="wrap">
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment