加入收藏 | 设为首页 | 会员中心 | 我要投稿 惠州站长网 (https://www.0752zz.com.cn/)- 办公协同、云通信、物联设备、操作系统、高性能计算!
当前位置: 首页 > 建站 > 正文

45个值得收藏的CSS形状

发布时间:2019-04-24 05:55:15 所属栏目:建站 来源:前端小智
导读:副标题#e# CSS能够生成各种形状。正方形和矩形很容易,因为它们是 web 的自然形状。添加宽度和高度,就得到了所需的精确大小的矩形。添加边框半径,你就可以把这个形状变成圆形,足够多的边框半径,你就可以把这些矩形变成圆形和椭圆形。 我们还可以使用 CS

36.雪佛龙

  1. #chevron {  
  2. position: relative;  
  3. text-align: center;  
  4. padding: 12px;  
  5. margin-bottom: 6px;  
  6. height: 60px;  
  7. width: 200px;  
  8. }  
  9. #chevron:before {  
  10. content: '';  
  11. position: absolute;  
  12. top: 0;  
  13. left: 0;  
  14. height: 100%;  
  15. width: 51%;  
  16. background: red;  
  17. transform: skew(0deg, 6deg);  
  18. }  
  19. #chevron:after {  
  20. content: '';  
  21. position: absolute;  
  22. top: 0;  
  23. right: 0;  
  24. height: 100%;  
  25. width: 50%;  
  26. background: red;  
  27. transform: skew(0deg, -6deg);  
  28. }  

37.放大镜

  1. #magnifying-glass {  
  2. font-size: 10em;  
  3. display: inline-block;  
  4. width: 0.4em;  
  5. box-sizing: content-box;  
  6. height: 0.4em;  
  7. border: 0.1em solid red;  
  8. position: relative;  
  9. border-radius: 0.35em;  
  10. }  
  11. #magnifying-glass:before {  
  12. content: "";  
  13. display: inline-block;  
  14. position: absolute;  
  15. right: -0.25em;  
  16. bottom: -0.1em;  
  17. border-width: 0;  
  18. background: red;  
  19. width: 0.35em;  
  20. height: 0.08em;  
  21. transform: rotate(45deg);  
  22. }  

38.Facebook图标

  1. #facebook-icon {  
  2. background: red;  
  3. text-indent: -999em;  
  4. width: 100px;  
  5. height: 110px;  
  6. box-sizing: content-box;  
  7. border-radius: 5px;  
  8. position: relative;  
  9. overflow: hidden;  
  10. border: 15px solid red;  
  11. border-bottom: 0;  
  12. }  
  13. #facebook-icon:before {  
  14. content: "/20";  
  15. position: absolute;  
  16. background: red;  
  17. width: 40px;  
  18. height: 90px;  
  19. bottom: -30px;  
  20. right: -37px;  
  21. border: 20px solid #eee;  
  22. border-radius: 25px;  
  23. box-sizing: content-box;  
  24. }  
  25. #facebook-icon:after {  
  26. content: "/20";  
  27. position: absolute;  
  28. width: 55px;  
  29. top: 50px;  
  30. height: 20px;  
  31. background: #eee;  
  32. right: 5px;  
  33. box-sizing: content-box;  
  34. }  

(编辑:惠州站长网)

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

推荐文章
    热点阅读