尊敬するstackoverflowers、
背景パターンで三角形要素を作成するにはどうすればよいですか?
たとえば、次のような div が必要です。
しかし、私の状態は次のようなものです:
三角形要素を含むすべての例では、その中に img を含めることができない境界線を使用しています ....
これは、coolarrow が必要なサブセクション クラスです。
<div class="subsection"><span>Ryan Gosling, Mr Landlord</span></div>
.subsection {
.box-shadow (0, -1px, 1px, 0, rgba(0, 0, 0, 0.3));
background: url('/assets/pattern-lorem.png'); // The inner part of the slider have the pattern
display: block;
clear: both;
float: left;
width: 100%;
padding-top: 15px;
padding-bottom: 15px;
display: none;
}
.subsection {
position:relative;
}
.subsection:before {
content:'';
position:absolute;
top:0;
left:0;
height:20px;
width:0;
border-left:20px solid white;
border-bottom:16px solid transparent;
}
.subsection:after {
content:'';
position:absolute;
top:36px;
left:0;
bottom:0;
width:0;
border-left:20px solid white;
border-top:16px solid transparent;
}
そして、私は得ています:
どちらがいいですか...どうすれば必要な形で矢印を一番上に持ってくることができますか? ...そして、ケース div をオーバーレイしますか? ... ありがとう。