прямоугольный Треугольник с обводкой
Народ подскажите как будет выглядить код, как сделать прямоугольный треугольник понимаю, а оводку вокруг прямоугольного не выходит
<div class="box arrow-top">
This is a box with some content and an arrow at the top.
</div>
.box {
width: 150px;
height: 75px;
background-color: grey;
color: #fff;
padding: 20px;
position: relative;
margin: 40px;
float: left;
}
.box.arrow-top:after {
content: " ";
position: absolute;
right: 30px;
top: -15px;
border-top: none;
border-right: 15px solid transparent;
border-bottom: 15px solid grey;
}
Ответы (1 шт):
Автор решения: OPTIMUS PRIME
→ Ссылка
Можно сделать один черный треугольник, чуть побольше. И накрыть его мелким красным:
.dialog {
position: relative;
width: 300px;
height: 100px;
margin: 40px;
background-color: #c22;
border: 5px solid black;
padding: 5px;
color: white;
}
.dialog::before {
content: "";
position: absolute;
width: 0;
height: 0;
border: 28px solid transparent;
border-right-color: #000;
transform: rotate(-45deg);
top: -28px;
left: 7px;
}
.dialog::after {
content: "";
position: absolute;
width: 0;
height: 0;
border: 20px solid transparent;
border-right-color: #c22;
transform: rotate(-45deg);
top: -20px;
left: 20px;
}
<div class="dialog">
This is a box with some content and an arrow at the top.
</div>
