我已经知道我的问题的解决方案,但我想知道为什么会这样.为什么背景会覆盖背景大小?请不要写关于交叉浏览.
HTML
<div class="icon"></div>
Run Code Online (Sandbox Code Playgroud)
CSS
.icon {
height: 60px;
width: 60px;
background-size: 60px 60px;
background: transparent url("icon.png") no-repeat 0 0;
}
Run Code Online (Sandbox Code Playgroud)
DEMO
解
在background-size下面插入说明background