我正在試圖動態填充帶有懸停時的圖片的圓形,將顯示橙色色調。但是,我有一個奇怪的橙色邊框的圖片。關於如何「拉伸」圖片以覆蓋橙色的任何想法?先謝謝你!下面的代碼:圓形覆蓋圖不會伸展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