Skip to content

Instantly share code, notes, and snippets.

@limarc
Created October 23, 2014 07:29
Show Gist options
  • Select an option

  • Save limarc/14a00c749b8db67efc1b to your computer and use it in GitHub Desktop.

Select an option

Save limarc/14a00c749b8db67efc1b to your computer and use it in GitHub Desktop.
In between margin trick
/* Old */
.classname {
...
margin-top: 20px;
}
.classname:first-child {
margin-top: 0;
}
/* New */
.classname {
...
}
.classname:not(:first-child):not(:root) {
margin-top: 20px;
}
/* @fix IE8 */
.ie8 .classname * + * {
margin-top: 20px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment