CSS 将比例尺转换为背景图片
CSS transform scale to background image
我喜欢 CSS 部分效果图
.split-banner .right-cl:hover img {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
我需要将以上 CSS 应用于包含在 div 元素中的背景图像
我该怎么做?
悬停时更改 background-size
。要模仿 scale(1.1)
使用 110%
.
div {
width: 560px;
height: 400px;
background: url('http://kenwheeler.github.io/slick/img/fonz1.png') center center no-repeat;
}
div:hover {
background-size: 110%;
}
<div></div>
我喜欢 CSS 部分效果图
.split-banner .right-cl:hover img {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
我需要将以上 CSS 应用于包含在 div 元素中的背景图像 我该怎么做?
悬停时更改 background-size
。要模仿 scale(1.1)
使用 110%
.
div {
width: 560px;
height: 400px;
background: url('http://kenwheeler.github.io/slick/img/fonz1.png') center center no-repeat;
}
div:hover {
background-size: 110%;
}
<div></div>