批改状态:合格
老师批语:完成的不错,继续加油
<style>.box {width: 300px;height: 300px;/* border: 1px solid #000; */border-radius: 150px;background-color: lightgreen;/* 因为内边距是透明的,只能设置宽度不能设置样式,因此,背景色默认可以从内边距透出来 *//* padding: 20px; *//* 控制背景的覆盖范围限制在内容区,裁切 */background-clip: border-box;background-clip: content-box;/* 渐变 */background: linear-gradient(red, yellow);background: linear-gradient(45deg, red, yellow);background: linear-gradient(to right, red, yellow);background: linear-gradient(to left,rgba(255, 0, 0, 0.5), /*最后一个为透明度*/white,yellow,white,yellow); /*多个颜色的时候相互就会间隔开,形成颜色波*//* background-clip: content-box; */</style>
<style>/* background-image: url("girl.jpg"); */background-repeat: no-repeat; /*否则会填满*//* background-repeat: repeat-y; 在横向或纵向上repeat*//* background-attachment: fixed; *//* 背景定位: 位置 *//* background-position: 50px 60px; *//* background-position: right center; *//* background-position: center right; *//* 只写一个,第二个默认就是center *//* background-position: left; *//* background-position: 50% 20%; *//* 只写一个,第二个默认就是50% 这种情况下就是居中显示*//* background-position: 50% 50%; */background-size: contain; /*单张的整体显示*/background-size: cover; /*整图展开*//* 简写 */background: violet;background: url("girl.jpg") no-repeat center;position: relative;top: 20px;left: 30px;/* box-shadow: 5px 8px 10px #888; */}.box:hover {/* 外发光。左阴影大小,右阴影大小,阴影模糊化。最后的是颜色*/box-shadow: 0 0 8px #888;cursor: pointer;}</style>
精灵图类似一张有很多相同大小的icon、头像等的大图。
然后通过建立一个跟每个icon大小一样的box的方式,来通过坐标(其实就是图片位置)挪动图片,让我们想看到的图片刚好在box中。
<style>.box1 { /*这个是用来显示大图的*/width: 500px;height: 400px;border: 1px solid #000;background-image: url("1.png");background-repeat: no-repeat;background-position: 50px 20px;}.box2 { /*这个用来显示大图中的每个小图。最后的-220px等就是位置移动*/width: 110px;height: 110px;background-image: url("1.png");background-repeat: no-repeat;background-position: -220px -110px;}.box3 {width: 110px;height: 110px;background-image: url("1.png");background-repeat: no-repeat;background-position: -220px -220px;}</style></head><body><div class="box1"></div><div class="box2"></div><div class="box3"></div></body>
牛的企业都在探索创新。开始可能是为了自己内部用。到一定程度了就公开,让社会去用。
字体图标外贸是图标,但其实可以看作是字体。因为具有字体的各种属性。例如大小、颜色,按照编码进行加载等。
下面这个图形中的小太阳就是阿里字体图标产生出来的。当然是选择了多个span后。
<div><span class = "iconfont icon-san umrl"></span></div><form action=""><label for="psw"><input type="password" name="password" /><span class="iconfont open-eye"></span></label></form>

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号