背景
- background
- background-attachment;背景图像是否固定或者随着页面的其余部分滚动
- background-color
- background-image
- background-position
- background-repeat
- background-size
background-size: cover | contain
http://js.jirengu.com/jaboxuwora/3/edit
CSS Sprite(CSS雪碧图)
- 将不同的图片/图标合并在一张图上
- 使用CSS Sprite可以减少网络请求,提高网页加载性能
隐藏or透明
- opacity: 0; 透明度为0,整体
- visibility:hidden;
- display:none; 消失,不用占位置,脱离普通流
- background-color: rgba(0, 0, 0, 0.1);只是背景色透明
inline-block
(inline的只有左右magin,padding有效,上下无效)
- 既成现inline特性,不占据一整行,宽度由内容宽度决定
- 又呈现block特性,可以设置宽高,内外边距
- 缝隙问题(inline产生)
line-height
- 属性设置行间的距离(行高)
值 | 描述 |
---|---|
normal | 默认。设置合理的行间距。 |
number | 设置数字,此数字会与当前的字体尺寸相乘来设置行间距。 |
length | 设置固定的行间距。如20px |
% | 基于当前字体尺寸的百分比行间距。 |
inherit | 规定应该从父元素继承 line-height 属性的值。 |
- line-height: 数字/百分比 区别
line-height可以继承
数字的时候会将倍数继承
百分比的时候会继承父元素计算后的行高值
网友评论