加入收藏 | 设为首页 | 会员中心 | 我要投稿 晋中站长网 (https://www.0354zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > 建站资源 > 优化 > 正文

45个值得收藏的CSS形状

发布时间:2019-04-23 13:11:29 所属栏目:优化 来源:前端小智
导读:CSS能够生成各种形状。正方形和矩形很容易,因为它们是 web 的自然形状。添加宽度和高度,就得到了所需的精确大小的矩形。添加边框半径,你就可以把这个形状变成圆形,足够多的边框半径,你就可以把这些矩形变成圆形和椭圆形。 我们还可以使用 CSS 伪元素

31. 8点 爆发

  1. #burst-8 {  
  2. background: red;  
  3. width: 80px;  
  4. height: 80px;  
  5. position: relative;  
  6. text-align: center;  
  7. transform: rotate(20deg);  
  8. }  
  9. #burst-8:before {  
  10. content: "";  
  11. position: absolute;  
  12. top: 0;  
  13. left: 0;  
  14. height: 80px;  
  15. width: 80px;  
  16. background: red;  
  17. transform: rotate(135deg);  
  18. }  

32.太极

  1. #yin-yang {  
  2. width: 96px;  
  3. box-sizing: content-box;  
  4. height: 48px;  
  5. background: #eee;  
  6. border-color: red;  
  7. border-style: solid;  
  8. border-width: 2px 2px 50px 2px;  
  9. border-radius: 100%;  
  10. position: relative;  
  11. }  
  12. #yin-yang:before {  
  13. content: "";  
  14. position: absolute;  
  15. top: 50%;  
  16. left: 0;  
  17. background: #eee;  
  18. border: 18px solid red;  
  19. border-radius: 100%;  
  20. width: 12px;  
  21. height: 12px;  
  22. box-sizing: content-box;  
  23. }  
  24. #yin-yang:after {  
  25. content: "";  
  26. position: absolute;  
  27. top: 50%;  
  28. left: 50%;  
  29. background: red;  
  30. border: 18px solid #eee;  
  31. border-radius: 100%;  
  32. width: 12px;  
  33. height: 12px;  
  34. box-sizing: content-box;  
  35. }  

(编辑:晋中站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读