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

45个值得收藏的CSS形状

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

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. }  

(编辑:晋中站长网)

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

热点阅读