左下隅に矢印の付いたボックスを作成する必要があります。私の問題は、非対称の三角形を取得することです。
左下隅に三角形があるボックスの下の境界線の例を次に示します。
これはこれまでの私の試みです:
.box {
width: 150px;
height: 75px;
background-color: black;
color: #fff;
padding: 20px;
position: relative;
margin: 40px;
float: left;
}
.box.arrow-bottom:after {
content: " ";
position: absolute;
left: 0px;
bottom: -15px;
border-top: 15px solid black;
border-right: 15px solid transparent;
border-left: 15px solid transparent;
border-bottom: none;
}
<div class="box arrow-bottom">
This is a box with some content and an arrow at the bottom.
</div>
境界線の幅を少し編集して、を追加しましたtransform: skewX()
。あなたはスキューのために適切な量で遊ぶかもしれません。さらに、に:after
変更され:before
、left
プロパティで遊んで、を削除しましたright
。
それが役に立てば幸い:
.box {
width: 150px;
height: 75px;
background-color: black;
color: #fff;
padding: 20px;
position: relative;
margin: 40px;
float: left;
}
.box.arrow-bottom:before {
content: " ";
position: absolute;
left: 8px;
bottom: -15px;
border-top: 15px solid black;
border-right: 0px solid transparent;
border-left: 15px solid transparent;
border-bottom: none;
transform: skewX(20deg);
}
<div class="box arrow-bottom">
This is a box with some content and an arrow at the bottom.
</div>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加