11 Star 37 Fork 20

Baryy / You-need-to-know-css

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ellipse.md 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
LHammer 提交于 2018-04-08 10:16 . :wrench:style: amend id of vuep'template

圆与椭圆

?> 背景知识::point_right: border-radius

通常我们一般使用border-radius来时实现圆角效果,其实border-radius是可以单独指定它的半长轴和半短轴,只需要用“/”分割即可。我们可以通过这个属性轻松实现半圆、半椭圆、四分之一圆及四分之一圆等常见的图形。

<script v-pre type="text/x-template" id="ellipse"> <style> main{ width: 100%; padding: 60px 0; display: flex; flex-wrap: wrap; justify-content: space-around; } div{ width: 200px; height: 150px; background: #b4a078; margin-bottom: 30px; } .ellipse:nth-of-type(1){ width: 300px; height: 150px; border-radius: 50% / 100% 100% 0 0; } .ellipse:nth-of-type(2){ width: 150px; height: 150px; border-radius: 100% 0 0 0; } .ellipse:nth-of-type(3){ border-radius: 50% / 100% 100% 0 0; } .ellipse:nth-of-type(4){ width: 100px; border-radius: 100% 0 0 0; } .ellipse:nth-of-type(5){ width: 300px; border-radius: 50% / 0 100%; } .ellipse:nth-of-type(6){ width: 300px; border-radius: 50% / 100% 0; } </style>
<script> </script> </script>

浏览器支持

<iframe src="https://caniuse.bitsofco.de/embed/index.html?feat=border-radius&periods=future_1,current,past_1,past_2,past_3&accessible-colours=false" frameborder="0" width="100%" height="458px"></iframe>
CSS
1
https://gitee.com/lhammer/You-need-to-know-css.git
git@gitee.com:lhammer/You-need-to-know-css.git
lhammer
You-need-to-know-css
You-need-to-know-css
master

搜索帮助