Created
January 7, 2015 22:11
-
-
Save iainmcampbell/4fe348a6a50b159dab2b to your computer and use it in GitHub Desktop.
Responsive SVG
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
/* have to use intrinsic ratio: http://alistapart.com/article/creating-intrinsic-ratios-for-video */ | |
.svg-container { | |
width: 100%; | |
display: block; | |
height: auto; | |
position: relative; | |
padding-top: 100%; // ratio: w/h*100 | |
} | |
svg { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0; | |
left: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment