Blogger Information
Blog 14
fans 2
comment 1
visits 8007
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
css基础:字体图标使用及自定义样式、媒体查询
梦想
Original
678 people have browsed it

字体图标

阿里库下载字体图标
下载后文件夹放到根目录,命名为font_icon

新建一个css文件用于引入官方icon样式及自定义样式icon.css

icon首先引入官方库@import '../font_icon/iconfont.css';
在html中引入css/icon.css

  1. <link rel="stylesheet" href="css/icon.css">
  2. <legend>
  3. <!-- 使用字体图标 -->
  4. <span class="iconfont icon-zhuce zhuce">用户注册</span>
  5. </legend>


自定义图标样式 (推荐使用)

  1. .zhuce {
  2. /*字体大小 由于图标也是字体类型使用font-size也可以设置大小*/
  3. font-size: 30px;
  4. /*字体颜色*/
  5. color: bisque;
  6. }

媒体查询

设置屏幕宽度如果大于1200字体颜色为红色

  1. @media (min-width:1200px) {
  2. p{
  3. color: red;
  4. }
  5. }


最小宽度为600px,最大宽度为1199px
当前屏幕>600<1199 字体颜色为绿色

  1. @media (min-width:600px) and (max-width:1199px) {
  2. p{
  3. color: rgb(21, 241, 13);
  4. }
  5. }


最大宽度为599px 当前屏幕<599px 文字颜色为蓝色

  1. @media (max-width:599px) {
  2. p{
  3. color: blue;
  4. }
  5. }

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