Created
October 8, 2018 17:51
-
-
Save jimfloss/a6a1567bb74e9f73b26461d6c301cbd7 to your computer and use it in GitHub Desktop.
Responsive Squares
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
<style> | |
.square { | |
position: relative; | |
width: 50%; | |
} | |
.square:after { | |
content: ""; | |
display: block; | |
padding-bottom: 100%; | |
} | |
.content { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
} | |
</style> | |
<div class="square"> | |
<div class="content"> | |
Hello! | |
</div> | |
</div> | |
<!-- https://spin.atomicobject.com/2015/07/14/css-responsive-square/ --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment