Created
July 9, 2014 15:25
-
-
Save timhettler/e9dd1bb8f1611c81f92b to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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
<div class="background"></div> |
This file contains 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
// ---- | |
// Sass (v3.3.9) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
@mixin ratio($width, $height) { | |
&:before { | |
content: ''; | |
display: block; | |
padding-bottom: percentage($height / $width); | |
} | |
} | |
.background { | |
@include ratio(25,10); | |
max-width: 50%; | |
margin: 0 auto; | |
&:before { | |
background: red; | |
} | |
} |
This file contains 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
.background { | |
max-width: 50%; | |
margin: 0 auto; | |
} | |
.background:before { | |
content: ''; | |
display: block; | |
padding-bottom: 40%; | |
} | |
.background:before { | |
background: red; | |
} |
This file contains 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
<div class="background"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment