我有一個響應標題我創建了一半的作品。響應背景圖像創建額外空間
在Google Chrome瀏覽器中,當窗口縮小並且FireFox中不允許灰度效果時,它會增加額外的間距。我想刪除該間距並允許灰度懸停。
這是兩者之間的區別。
網址是http://www.bradlyspicer.net
#header {
min-height: 310px;
margin: 0px;
padding: 0px;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
}
.home-header {
min-height: 310px;
background-image: url('http://hdwallpapercollection.com/wp-content/uploads/2013/08/roma-city-wallpaper.jpg');
background-repeat: no-repeat;
background-position: 0% -150;
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-o-filter: grayscale(100%);
-ms-filter: grayscale(100%);
filter: grayscale(100%);
-o-transition:.5s;
-ms-transition:.5s;
-moz-transition:.5s;
-webkit-transition:.5s;
/* ...and now for the proper property */
transition:.5s;
}
.home-header:hover {
-webkit-filter: grayscale(0%);
-moz-filter: grayscale(0%);
-o-filter: grayscale(0%);
-ms-filter: grayscale(0%);
filter: grayscale(0%);
}
嗨,感謝您的評論,它是否採取灰度(100%)或0.33%的部分作爲值,與參數略有混淆haha –
其實它是用svg寫的,因爲之前的濾鏡是爲svg開發的。現在,它適用於包含圖像的其他人。不要擔心0.33%,因爲您的圖片灰度會變爲100%。 –