輸出CSSの国境の三角形が実現しています

1、HTML

<! - 中空三角形- > 
<! - アップトライアングル- > 
< divのクラス= "国境の空アップ" > 
    < スパン> </ スパン> 
</ divの> 
<! - 下向き三角形- > 
< divのクラス= "ボーダーダウン・空" > 
    < スパン> </ スパン> 
</ divの> 
<! - の左側にある三角形- > 
< divのクラス= "国境左空" > 
    < スパン> </ スパン> 
</ divの> 
<! - 直角三角形- > 
< divのクラス= "のborder-right-空" > 
    < スパン> </ スパン> 
</ DIV >

2、CSS

.borderアップ空 { 0
    高さ0 ; 
    国境左30px固体透明
    border-right30px固体透明
    border-bottom30px固体#333 ; 
    位置相対 ; 
    マージンは50px自動 ; 
} 
.borderアップ空スパン { 
    表示ブロック0 ; 
    高さ0; 
    ボーダー左透明28pxソリッド ; 
    のborder-right28pxソリッド透明 ; 
    のborder-bottom28pxピンク色の固体 ; //白に、中空の三角形は、2行である場合。
    位置絶対 ; -28px ; 
    トップ2ピクセル ; 
} 
.borderダウン空 { 0 ; 
    高さ0 ; 
    ボーダー左30px固体透明 ; 
    ボーダー右透明30px固体 ; 
    border-top30px固体#333 ; 
    位置相対 ; 
    マージンは50px自動 ; 
} 
.borderダウン空スパン { 
    表示ブロック0 ; 
    高さ0 ; 
    国境左28px固体透明
    border-right28px固体透明
    border-topピンク28px固体 ; 
    ポジション絶対 ; -28px ; 
    トップ-30px ; 
} 
.border左空 { 0
    高さ0 ; 
    border-bottom30px固体透明
    border-right30px固体#333 ; 
    border-top30px固体透明
    位置相対 ; 
    マージンは50px自動 ; 
} 
.border左空スパン{ 
    表示ブロック0 ; 
    高さ0 ; 
    border-bottom28px固体透明
    border-right28pxソリッドピンク
    border-top28px固体透明
    位置絶対 ; 2ピクセル
    トップ-28px ; 
} 
.border右空 { 0
    高さ0 ; 
    国境左30px固体#333 ; 
    border-bottom30px固体透明
    border-top30px固体透明
    位置相対 ; 
    マージンは50px自動 ; 
} 
.border空右スパン { 
    表示ブロック0 ; 
    高さ0 ; 
    国境左ピンク28px固体 ; 
    border-bottom固体透明28px ; 
    border-top28px固体透明
    位置絶対 ; -30px ; 
    トップ-28px ; 
}

3、図の効果。

原則として2つの三角形は、位置及び色差を重畳します。

おすすめ

転載: www.cnblogs.com/camille666/p/css_triangle_border_half.html