私は 'negative border radius'(私はより良い説明がない)でタグシステムを構築しようとしています。MSIEの奇妙な1pxオフセット:afterと:before
私は:after
と:before
を使用して、いくつかの偽の境界を '外側に曲げる'ように作成します。それはうまくいきましたが、MSIEではいくつかの奇妙な動作があります。
何ができることを:通常、私が:after
と:before
にtop:5px
を持っているが、IEで、私は、余分なピクセルを追加する必要があります(top: 6px
の結果は)(左に水平線を、右表示すべきではないIE8で参照してください)あれ?
<div class="test"><div>foo</div></div>
body {
background: gold;
margin: 10px;
}
.test {
display: inline-block;
height: 30px;
overflow: hidden;
}
.test > div {
background: white;
border-top-left-radius: 5px;
border-top-right-radius : 5px;
height: 20px;
padding: 5px;
display: inline-block;
}
.test:before {
content: '';
width: 5px;
height: 20px;
position: relative;
top: 5px;
margin-right: -5px;
background: none;
border-color: white;
border-style: solid;
border-width: 0px;
border-bottom-width:5px;
border-right-width:5px;
border-bottom-right-radius: 10px;
display: inline-block;
vertical-align: middle;
z-index: -1;
}
.test:after {
content: '';
width: 5px;
height: 20px;
position: relative;
top: 5px;
margin-left: -5px;
background: none;
border-color: white;
border-style: solid;
border-width: 0px;
border-bottom-width:5px;
border-left-width:5px;
border-bottom-left-radius: 10px;
display: inline-block;
vertical-align: middle;
z-index: -1;
}
私は今、マックにいるのでIEでこれをテストすることはできませんが、 [ボックスモデルのバグ](http://ja.wikipedia.org/wiki/Internet_Explorer_box_model_bug)を修正しますか? '-webkit-box-sizing:border-box;を追加してみてください。 -moz-box-sizing:ボーダーボックス。ボックスサイズ:border-box; 'それがうまくいくかどうかを調べる。 – Cthulhu
あなたのフィドルは、最新のFirefox、Opera、Webkitで違って見えます... – user123444555621