Как реализовать сужающийся border на css
Как можно реализовать такой border на css, чтобы он шел снизу вверх и сужался, а где-то на середине заканчивался?
Вот дизайн:

Ответы (2 шт):
Автор решения: Rickes417
→ Ссылка
div {
margin: 10px 20px;
width: 200px;
height: 120px;
box-shadow: 0 0 5px rgba(0,0,0,.2);
position: relative;
}
div:hover {
border-bottom: 3px solid #f00;
}
div:hover:before, div:hover:after {
content: "";
display: block;
position: absolute;
bottom: -3px;
}
div:before {
border: 120px solid transparent;
border-bottom: 0px solid transparent;
border-left: 0px solid transparent;
border-right: 3px solid #f00;
left: -3px;
}
div:after {
border: 120px solid transparent;
border-bottom: 0px solid transparent;
border-right: 0px solid transparent;
border-left: 3px solid #f00;
right: -3px;
}
<div></div>
Автор решения: MaximLensky
→ Ссылка
Примерно так
.item {
width: 300px;
height: 160px;
background: linear-gradient(transparent 50%, pink);
padding: 2px;
}
.outer {
width: 100%;
height: 100%;
background: #fff;
display: flex;
align-items: center;
}
img {
display: block;
height: 150px;
margin-left: 3px;
}
.outer div {
margin-left: 10px;
height: 100%;
position: relative;
}
.outer div a {
text-decoration: none;
position: absolute;
bottom: 0;
left: 0;
padding: 4px 0
}
<div class="item">
<div class="outer">
<img src="https://www.e-news.pro/uploads/posts/2018-05/1525395939_e-news.su_43346481_from_me_to_you_00000000.jpg" alt="">
<div>
<span>Beatles</span>
<svg viewBox="0 0 200 30" width="100">
<path d="M0,15 15,0 30,15 45,0 60,15 75,0 90,15" fill="none" stroke="pink" stroke-width="4"/>
</svg>
<span> 4000.26 Р-р</span>
<a href="#">Смотреть</a>
</div>
</div>
</div>