Skip to content

Instantly share code, notes, and snippets.

@gunnarbittersmann
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save gunnarbittersmann/60085a1b7a75e7406e25 to your computer and use it in GitHub Desktop.

Select an option

Save gunnarbittersmann/60085a1b7a75e7406e25 to your computer and use it in GitHub Desktop.
responsive stack
/**
* responsive stack
*/
* { box-sizing: border-box }
html, body {margin: 0; padding: 0 }
ul { padding: 0; list-style: none }
li
{
width: 12em;
height: 12em;
margin: 2em auto;
border: 1em solid red;
border-radius: 100%;
background: yellow;
}
@media (min-width: 30em)
{
ul { width: 30em; margin: auto; padding: 1.5em 0 }
li { float: left; margin: 0.25em 1.5em }
li:nth-child(3n) { margin-left: 9em }
}
@media (min-width: 45em)
{
ul { width: 45em }
li:nth-child(3n) { margin-left: 1.5em }
li:nth-child(5n+4) { margin-left: 9em }
}
<ul><li><li><li><li><li><li><li><li><ul/>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment