找回密码
 免费注册

css3椭圆或半椭圆特效制作

[复制链接]
发表于 2023-1-4 10:05:10 | 显示全部楼层 |阅读模式
css3椭圆或半椭圆特效制作

然后通过border-radius属性来设置圆角,在ellipse属性里添加:border-radius:100%; 即可设置椭圆。



为了兼容各种浏览器我们在这里还要添加

  1. -o-border-radius:100%;
  2. -ms-border-radius:100%;
  3. -moz-border-radius:100%;
  4. -webkit-border-radius:100%;
复制代码
案例代码:
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>css制作椭圆</title>
  6. <style>
  7. .ellipse{
  8. width: 200px;
  9. height: 100px;
  10. background-color: red;
  11. border-radius:100%;
  12. -o-border-radius:100%;
  13. -ms-border-radius:100%;
  14. -moz-border-radius:100%;
  15. -webkit-border-radius:100%;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div class="ellipse"></div>
  21. </body>
  22. </html>
复制代码
输出结果界面如下:

css3椭圆或半椭圆特效制作

css3椭圆或半椭圆特效制作



QQ|Archiver|小黑屋|网站地图|深圳市金黑网络技术有限公司 ( 粤ICP备2021124338号|粤公网安备 44030702003689号 )

GMT+8, 2026-8-8 18:01 , Processed in 0.058201 second(s), 27 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表