Skip to content

Instantly share code, notes, and snippets.

@lluisgerard
Forked from rginamt/dabblet.css
Created July 13, 2012 10:30
Show Gist options
  • Save lluisgerard/3104122 to your computer and use it in GitHub Desktop.
Save lluisgerard/3104122 to your computer and use it in GitHub Desktop.
Center lists
/**
* Center lists
*/
div {
width: 100%;
overflow:hidden;
position:relative;
}
div ul {
float:left;
position:relative;
left:50%;
list-style:none;
}
div ul li {
float:left;
position:relative;
right:50%;
padding:10px;
}
<!-- content to be placed inside <body>…</body> -->
<body>
<div>
<ul>
<li> budgies </li>
<li> cats </li>
<li> dogs </li>
<!-- the content increase -->
<li> more budgies </li>
<li> more cats </li>
<li> more dogs </li>
<ul>
</div>
</body>
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment