Skip to content

Instantly share code, notes, and snippets.

@willeccles
Last active August 29, 2015 14:24
Show Gist options
  • Save willeccles/25684fd010b5f71353f0 to your computer and use it in GitHub Desktop.
Save willeccles/25684fd010b5f71353f0 to your computer and use it in GitHub Desktop.
Make a div round
/* 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