Last active
August 29, 2015 14:24
-
-
Save willeccles/25684fd010b5f71353f0 to your computer and use it in GitHub Desktop.
Make a div round
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
/* to make a div round, the width and height must be the same (a square) | |
also, the border radius must be half of the w/h | |
so for a div 42x42, the radius should be 21. */ | |
.my-round-div { | |
background-image: url("my-square-or-round-image.png"); | |
display: block; | |
height: 42px; | |
width: 42px; | |
border-radius: 21px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment