我正在編碼一個簡單的樂隊,在我的網站瀏覽器的底部。我用一個半透明的PNG作爲我的背景,控制了一切,但爲了獲得更大的靈活性,我被要求純粹用CSS來完成。所以我使用了RGBa背景,使用了一個條件樣式表,爲IE 8和更早版本提供了微軟過濾器。這工作正常,我的背景看起來像我想要的。我遇到的問題是這個橫幅包含比它高的圖像。由於我已經添加了過濾器,現在它在IE中獲得裁剪...如果切換到純色背景,則一切正常。問題與圖像和透明過濾器的IE
這是一個已知的問題?有什麼解決方法嗎?
這裏是我的IE的CSS:
/* This is the banner taking the whole browser width */
#bottompub {
position:fixed;
bottom:0px;
left:0px;
width:100%;
height:50px;
text-align: center;
background: transparent;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#B289BAE4,endColorstr=#B289BAE4)"; /* IE8 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#B289BAE4,endColorstr=#B289BAE4); /* IE6 & 7 */
zoom: 1;
margin:0;
padding:0;
overflow:visible; /* Just to make sure no parent change that to hidden */
}
/* This is the image in the banner */
#bottompub .pubimage {
position:relative;
margin-left:220px;
height:75px;
}
/* This is to fit my content web site width the image is in there */
#bottompub .insidebottompub {
width:1031px;
margin-left:auto;
margin-right: auto;
}
下面是簡單的HTML:
<div id="bottompub">
<div class="insidebottompub">
<a href="http://www.mysite.com"><img class="pubimage" src="myimageof75px.png"/></a>
</div>
</div>
謝謝!
編輯不使用切緣陰性
感謝。我擺脫了負餘量,並使其無需過濾器。同樣,只要打開過濾器,它就會被裁剪。我不明白爲什麼你說隱藏的溢出,我用一個可見的,使其工作。我必須說,我不知道梯度的其他供應商前綴... – Melanie 2011-03-25 20:37:25
嗨,溢出的事情是不顯示大於其容器的圖像,所以你不必使用負邊距進行定位。 – Francisc 2011-03-26 15:19:03
在你的過濾器中,十六進制顏色代碼是錯誤的:'#B289BAE4'有很多字符。這可能是問題所在。 – Francisc 2011-03-26 15:19:35