diff --git a/snippets/circle.md b/snippets/circle.md new file mode 100644 index 000000000..60e373e18 --- /dev/null +++ b/snippets/circle.md @@ -0,0 +1,50 @@ +### Circle + +Creates a circle shape with pure CSS. + +#### HTML + +```html +
+``` + +#### CSS + +```css +.circle { + border-radius: 50%; + width: 2rem; + height: 2rem; + background: #333; +} +``` + +#### Demo + +
+
+
+ + + +#### Explanation + +`border-radius: 50%` curves the borders of an element to create a circle. + +Since a circle has the same radius at any given point, the `width` and `height` must be the same. Differing +values will create an ellipse. + +#### Browser support + +✅ No caveats. + +* https://caniuse.com/#feat=border-radius + +