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

45个值得收藏的CSS形状

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

41.圆锥

  1. #cone {  
  2. width: 0;  
  3. height: 0;  
  4. border-left: 70px solid transparent;  
  5. border-right: 70px solid transparent;  
  6. border-top: 100px solid red;  
  7. border-radius: 50%;  
  8. }  

42.十字架

  1. #cross {  
  2. background: red;  
  3. height: 100px;  
  4. position: relative;  
  5. width: 20px;  
  6. }  
  7. #cross:after {  
  8. background: red;  
  9. content: "";  
  10. height: 20px;  
  11. left: -40px;  
  12. position: absolute;  
  13. top: 40px;  
  14. width: 100px;  
  15. }  

43.根基

  1. #base {  
  2. background: red;  
  3. display: inline-block;  
  4. height: 55px;  
  5. margin-left: 20px;  
  6. margin-top: 55px;  
  7. position: relative;  
  8. width: 100px;  
  9. }  
  10. #base:before {  
  11. border-bottom: 35px solid red;  
  12. border-left: 50px solid transparent;  
  13. border-right: 50px solid transparent;  
  14. content: "";  
  15. height: 0;  
  16. left: 0;  
  17. position: absolute;  
  18. top: -35px;  
  19. width: 0;  
  20. }  

(编辑:晋中站长网)

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

热点阅读