I'm having difficulty modifying the CSS to display a yellow triangle containing text in the bottom right corner of a Bootstrap 4 card. Is there a way to achieve this effect using CSS?
This is how the current CSS output looks in a Bootstrap 4 card:
https://i.sstatic.net/QWLiT.jpg
Here is the desired outcome I want to achieve:
https://i.sstatic.net/qPaDd.jpg
.row {
position: relative;
min-height: 100px;
}
.triangle {
display: block;
width: 50px;
height: 50px;
font-size: 21px;
}
.triangle::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(to left top, #ffffff 49%, transparent 33%);
}
{
position: relative;
top: 5px;
left: 5px;
}
<div class="card card-ecommerce">
<a href="#" class="triangle btn-warning position-absolute">
<i class="fas fa-arrow-left" aria-hidden="true"></i></a>
<div class="view overlay">
<img src="https://i.sstatic.net/B73k3.jpg" class="img-fluid" alt="sample image">
<a>
<div class="mask rgba-white-slight"></div>
</a>
</div>
<div class="card-body">
<h5 class="card-title mb-1"><strong><a class="dark-grey-text">10% cashback</a> </strong></h5>
<span class="badge badge-danger mb-2">bestseller</span>
<div class="card-footer pb-0">
<div class="row mb-0">