If your page design requires one or more circle shapes, you don’t need to make or download (or steal or whatever) an image file to get the job done. You can turn to CSS and its border-radius
property:
border-radius: length|percentage;
length
px
, em
, rem
, vw
, or vh
.percentage
border-radius
is a shorthand property for border-top-left-radius
, border-top-right-radius
, border-bottom-right
, and border-bottom-left-radius
properties, each of which can take one or two length or percentage values. It can get complicated, but fortunately you can ignore all that complication if all you want is a circle shape, because that only requires two things:
- Apply the rule
border-radius: 50%;
to a block-level element (such as adiv
). - Apply a
height
andwidth
to that block-level element and give both properties the same value.
Here’s an example:
Browser support: % (Source: caniuse.com)
Specification: