1
扭曲我需要什麼(在所有瀏覽器,並得到僅適用於Chrome)設計在Firefox
我能得到什麼(在Firefox和Internet Explorer)
我有試圖找到造成問題的代碼,但沒有成功。不過,我創建了一個小提琴,如果涉及到任何幫助
.graph {
bottom: 1rem;
display: inline-block;
margin-top: 3rem;
position: relative;
width: 17rem;
}
body {
font-family: LatoLight;
}
html {
font-family: LatoLight;
font-size: 125%;
}
.sections_green {
height: 0.3rem;
}
.green {
background-color: #accb3d;
display: inline-table;
}
.yellow {
background-color: #fec919;
display: inline-table;
}
.orange {
background-color: #fe8f10;
display: inline-table;
}
.red_dull {
background-color: #f98685;
display: inline-table;
}
.red {
background-color: #ed5f56;
display: inline-table;
}
.sections_red {
height: 0.3rem;
}
.arrow_box_green_bottom:after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #accb3d rgba(136, 183, 213, 0) rgba(136, 183, 213, 0);
border-image: none;
border-right: 0.5rem solid rgba(136, 183, 213, 0);
border-style: solid;
border-width: 0.5rem;
content:" ";
height: 0;
left: 50%;
margin-left: -0.5rem;
pointer-events: none;
position: absolute;
top: 100%;
width: 0;
}
.arrow_box_green_bottom {
background: none repeat scroll 0 0 #accb3d;
color: #fff;
display: inline-block;
font-size: 1rem;
font-weight: bold;
height: 1.5rem;
left: 6rem;
position: absolute;
text-align: center;
top: -1.3rem;
width: auto;
}
<div class="graph">
<div style="width: 5rem" class="sections_red red"></div>
<div style="width: 5rem" class="sections_green red_dull"></div>
<div style="width: 5rem" class="sections_green green">
<div style="left: 10rem;" class="arrow_box_green_bottom">65</div>
</div>
</div>
請點我在哪裏,我錯了
'.graph DIV { 顯示:內聯塊; } http://jsfiddle.net/7Lqv6x4n/1/ – MLeFevre 2015-02-09 10:21:26
@MLeFevre這很有用,非常感謝,你能告訴我爲什麼這會起作用嗎? – aelor 2015-02-09 10:24:55
從快速瀏覽它似乎很奇怪的行爲,你正在使用'display:inline-table;'應該工作正常(並在Chrome中),但由於某種原因在Firefox中,即使你的箭頭與類'.arrow_box_green_bottom '是絕對定位的,它在呈現佈局時仍將考慮其位置。例如,如果您隱藏箭頭http://jsfiddle.net/7Lqv6x4n/2/,則其他元素的位置就是您想要的。 – MLeFevre 2015-02-09 10:38:16