我尝试在背景img上使用悬停,如下所示:
.featuredimg{background: url('[imgPathHere]');
width:370px;
height:430px;}
.featuredimg:hover{background: url('[imgPathHere]')0px -430px;}问题是我使用的是twitter bootstrap,这样网站就可以响应了。如何在允许图像缩放的同时继续使用背景img悬停。现在,无论窗口大小如何,图像的宽度和高度都保持不变。
发布于 2013-03-06 00:25:45
请改用:before / :after或background-size属性来缩放背景图像。
https://stackoverflow.com/questions/15228081
复制相似问题