4.5.6 背景尺寸

background-size 效果演示

background-size

属性取值:




HTML代码:

<p class="size"></p>

CSS代码:

.size   {
	width: 180px;
	height: 120px;
	border: 10px dashed #888;
	background-image: url(../img/bg.gif);
	background-size: 50% 50%;
	background-repeat: no-repeat;
}

运行效果:

← 键盘方向键翻页 →