Blogger Information
Blog 10
fans 0
comment 0
visits 4896
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1025字体图标与媒体查询作业
onbind
Original
995 people have browsed it

字体图标

  1. <style>
  2. .flex{
  3. display: flex;
  4. align-items: center;
  5. justify-content: space-between;
  6. width: 400px;
  7. }
  8. /* CDN 服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
  9. /* CDN 服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
  10. @font-face {
  11. font-family: 'iconfont';
  12. src: url('iconfont.woff2?t=1666770435576') format('woff2'),
  13. url('iconfont.woff?t=1666770435576') format('woff'),
  14. url('iconfont.ttf?t=1666770435576') format('truetype');
  15. }
  16. .iconfont {
  17. font-family: "iconfont" !important;
  18. font-size: 16px;
  19. font-style: normal;
  20. -webkit-font-smoothing: antialiased;
  21. -moz-osx-font-smoothing: grayscale;
  22. }
  23. .icon-gouwucheman:before {
  24. content: "\e600";
  25. }
  26. .icon-shouye:before {
  27. content: "\e8c6";
  28. }
  29. .icon1{
  30. font-size: 36px;
  31. color: rebeccapurple;
  32. text-align: center;
  33. }
  34. .icon2{
  35. font-size: 36px;
  36. color: saddlebrown;
  37. text-align: center;
  38. }
  39. </style>
  40. <div class="flex">
  41. <div>
  42. <div class="iconfont icon1">&#xe600;</div>
  43. <div>使用unicode方式引用</div>
  44. </div>
  45. <div>
  46. <div class="iconfont icon-shouye icon2"></div>
  47. <div>使用class方式引用</div>
  48. </div>
  49. </div>

效果图

媒体查询

  1. <style>
  2. .box{
  3. margin-top: 100px;
  4. }
  5. .base{
  6. width: 500px;
  7. height: 500px;
  8. background-color: cadetblue;
  9. }
  10. /* 当可视宽度大于1100px时 */
  11. @media (min-width: 1100px) {
  12. .base{
  13. width: 500px;
  14. height: 500px;
  15. }
  16. }
  17. /* 当可视宽度大于700px 且 小于1100px时 */
  18. @media (min-width: 700px) and (max-width: 1100px) {
  19. .base{
  20. width: 350px;
  21. height: 350px;
  22. }
  23. }
  24. /* 当可视宽度小于700px时 */
  25. @media (max-width: 700px){
  26. .base{
  27. width: 100px;
  28. height: 100px;
  29. }
  30. }
  31. </style>
  32. <div class="box">
  33. <div class="base"></div>
  34. </div>

效果图

大图:

中图:

小图

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:完成的很好,继续加油
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post