Created
January 25, 2013 13:46
-
-
Save dennisfrank/4634583 to your computer and use it in GitHub Desktop.
Define aspect ratio for elements in CSS
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
/** | |
* Define aspect ratio for elements in CSS | |
*/ | |
div { | |
height: 0; | |
width: 33%; | |
padding-bottom: 33%; | |
float: left; | |
outline: 1px solid; | |
overflow: hidden; | |
} | |
marquee { | |
font-size: 140px; | |
} |
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> | |
<h1> | |
CAN I HAZ ASPECT RATIO BOXES? | |
</h1> | |
</div> | |
<div> | |
<img src="http://placekitten.com/g/500/500"> | |
</div> | |
<div> | |
<marquee>YES!</marquee> | |
</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
// alert('Hello world!'); |
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
{"view":"separate","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