該框在鉻,Safari瀏覽器和Firefox中顯示正確的顏色。但在IE中,框的顏色是黃色/金色。有關我正面臨的問題,請參閱下面的圖片。盒子的顏色在IE9中有所不同?
如何解決這個問題?
火狐:
IE9:
JSFIDDLE(在IE中打開該示例中)
HTML代碼:
<div id="container105">
<div class="bubbleouter">
<div class="bubbleinner"><CENTER><BOLD>VUL KOSTENLOOS DE OFFERTE IN EN WIJ BEREKEN DE PRIJS VAN UW SPECIFIEKE RIT<BOLD></CENTER></div>
</div>
</div>
CSS代碼:
}
.bubbleouter {
position:relative;
padding:3px;
margin:0;
width:280px;
z-index:99;
background:-webkit-gradient(linear, left top, left bottom, from(#272727), to(#222222));
background:-moz-linear-gradient(top, #272727, #222222);
background:-o-linear-gradient(top, #272727, #222222);
/* css3 */
-moz-border-radius:10px;
-webkit-border-radius:10px;
border-radius:10px;
}
.bubbleouter:after {
content:"";
display:block; /* reduce the damage in FF3.0 */
position:absolute;
top:-13px; /* value = - border-top-width - border-bottom-width */
left:50%; /* controls horizontal position */
margin:0 0 0 -18px;
width:0;
height:0;
z-index:99;
border-width:0 18px 14px; /* vary these values to change the angle of the vertex */
border-style:solid;
border-color:#222222 transparent;
}
.bubbleinner {
position:relative;
padding:15px;
margin:0;
color:#eee;
text-align:center;
z-index:100;
text-shadow:0px -1px 1px rgba(0, 0, 0, 0.8);
background:#f3961c; /* default background for browsers without gradient support */
border-top:1px solid #666666;
/* css3 */
-moz-border-radius:7px;
-webkit-border-radius:7px;
border-radius:7px;
/* NOTE: webkit gradient implementation is not as per spec */
background:-webkit-gradient(linear, left top, left bottom, from(#666666), to(#444444));
background:-moz-linear-gradient(top, #666666, #444444);
background:-o-linear-gradient(top, #666666, #444444);
}
.bubbleinner:after {
content:"";
display:block; /* reduce the damage in FF3.0 */
position:absolute;
top:-13px; /* value = - border-top-width - border-bottom-width */
left:50%; /* controls horizontal position */
margin:0 0 0 -16px;
width:0;
height:0;
z-index:99;
border-width:0 16px 12px; /* vary these values to change the angle of the vertex */
border-style:solid;
border-color:#666666 transparent;
}
偏題:''不是有效的HTML標記。 ''是有效的,但已被棄用。你應該使用CSS來代替這兩個; 'font-weight:bold'和'text-align:center'。 –
SDC
2013-02-26 12:43:24
請參閱下面的答案:http://stackoverflow.com/a/15089230/1317805。你接受的答案建議爲IE9使用固定的顏色,但IE9支持使用'filter'的漸變(就像IE6,7和8一樣!)。 – 2013-02-26 12:48:52