批改状态:合格
老师批语:
<link rel="stylesheet" href="css/style.css">
<div><!-- class里面的类名一定要注意看官方字体图标的介绍,不然会写错 --><span class="iconfont icon-wode mine"></span></div>
自定义样式实例代码:
/* 1. 引入官方的字体图标库 */@import url(../font_ico/iconfont.css);/* 自定义图标样式 */.mine{font-size: 60px;background-color: blue;}

/* 当屏幕分辨率在480px与1199px之间时,给html设置固定大小字号为14px */@media (max-width:1199px) and (min-width:480px){html{font-size: 14px;}}

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- <link rel="stylesheet" href="font_ico\iconfont.css"> --><link rel="stylesheet" href="css/style.css"><title>媒体查询</title></head><body><div class="box"><div class="one"></div><div class="two"></div><div class="three"></div></div><style>/* 设置根目录的字号大小 */html {font-size: 14px;}/* 设置box盒子为flex布局 */.box{display: flex;}/* 给三个one two three盒子设置默认样式 */.one{width: 10rem;height: 5rem;margin: auto;background-color: blue;}.two{width: 10rem;height: 5rem;margin: auto;background-color: aqua;}.three{width: 10rem;height: 5rem;margin: auto;background-color: lightgreen;}/* 媒体查询@media screen {} *//* 当屏幕分辨率大于或等于1200px时,给html设置固定大小字号 */@media (min-width:1200px) {html{font-size: 16px;}}/* 当屏幕分辨率在480px与1199px之间时,给html设置固定大小字号 */@media (max-width:1199px) and (min-width:480px){html{font-size: 14px;}}/* 限定最大宽度为480px,如若出现小于480px时 html将固定一个字号大小,不会在变化 */@media (max-width:480px){html{font-size: 13px;}}</style></body></html>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号