Created
October 23, 2014 07:29
-
-
Save limarc/14a00c749b8db67efc1b to your computer and use it in GitHub Desktop.
In between margin trick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 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