发表于: 2017-07-25 23:49:24
1 732
今天完成的事情:1.学习了iconfont使用方法;
2.学习了background-position和雪碧图(CSS Sprites)用法;
明天计划的事情:1.学习Bootstrap;
2.完成任务六header和footer的编写
遇到的问题:暂无
收获:1.iconfont使用方法;
1)去网站寻找适用的图标,点击下载代码,得到zip包,解压即可获得需要的文件。
2)将iconfont.css导入你的css文件,
.iconfont{ font-family:"iconfont"; font-size:16px; font-style:normal;
}
再放进HTML中
<i class="iconfont">*****</i>
2.学习了background-position和雪碧图(CSS Sprites)用法;
1)background-position有两个属性值, background-position:x | y,有三种表达方式
方向值:X left/right/center Y top/bottom/center
百分比:X 60%/20% Y 30%/80%
数字: X xx(单位 px em rem) Y xx(单位px em rem)
2)雪碧图CSS Sprites,也有人叫它CSS精灵,是一种CSS图像合并技术,该方法是将小图标和背景图像合并到一张图片上,然后利用CSS的背景定位来显示需要显示的图片部分。
1)利用border属性绘制小三角,只留一个三角的颜色
width:0;
height:0;
border-width:50px;
border-style:solid;
border-color:#2DC9FE
2)圆形/半圆/椭圆形绘制
line-height: 50px; width: 50px; height: 50px; text-align: center; border-radius: 50%; background-color: red;(圆)
width: 50px; height: 25px; border-radius: 25px 25px 0 0; background-color: red;(半圆)
line-height: 100px; width: 50px; height: 50px; text-align: center; border-radius: 50%; background-color: red;(椭圆)
评论