我正在试图动态填充带有悬停时的图片的圆形,将显示橙色色调。但是,我有一个奇怪的橙色边框的图片。关于如何“拉伸”图片以覆盖橙色的任何想法?先谢谢你!下面的代码:圆形覆盖图不会伸展100%
HTML代码:
<div class='overlay'>
<div class='circle' style='background:url(http://www.bigpicture.in/wp-content/uploads/2010/08/BlackAndWhitePortraitsPhotography26.jpg) 100% no-repeat;background-size:cover'>
</div>
CSS代码:
.circle {
float: left;
background: #d9d6d1;
width: 180px;
height: 180px;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
-moz-transition: all 0.5s;
-webkit-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
opacity:1;
filter:alpha(opacity=100);
}
.circle:hover {
opacity: 0.5;
filter:alpha(opacity=50);
}
.overlay {
float: left;
background:#fd761f;
margin: 5px;
width: 180px;
height: 180px;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
}
的jsfiddle:http://jsfiddle.net/hpPpD/
在Chrome开发人员工具中使用CSS播放我可以看到,橙色圆圈与您的照片不匹配。 – 2013-03-05 10:49:55
更改.bircle的高度和宽度为181px似乎可以解决问题......不知道为什么我的CSS不是那么好 – 2013-03-05 11:02:14