Merge pull request #57 from atomiks/circle

[FEATURE] Circle
This commit is contained in:
Stefan Feješ
2018-03-04 15:07:39 +01:00
committed by GitHub
7 changed files with 142 additions and 3 deletions

50
snippets/circle.md Normal file
View File

@ -0,0 +1,50 @@
### Circle
Creates a circle shape with pure CSS.
#### HTML
```html
<div class="circle"></div>
```
#### CSS
```css
.circle {
border-radius: 50%;
width: 2rem;
height: 2rem;
background: #333;
}
```
#### Demo
<div class="snippet-demo">
<div class="snippet-demo__circle"></div>
</div>
<style>
.snippet-demo__circle {
border-radius: 50%;
width: 2rem;
height: 2rem;
background: #333;
}
</style>
#### 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
<span class="snippet__support-note">✅ No caveats.</span>
* https://caniuse.com/#feat=border-radius
<!-- tags: visual -->