I am struggling to edit the CSS to show the yellow triangle containing text in the bottom right of a Bootstrap 4 card, in CSS, is there a way to achieve this effect?
This is what the css currently outputs in a Bootstrap 4 card:
And this is what I want to achieve:
.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.stack.imgur.com/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">


Try this code
I've created two triangle on both diagonal sides with text in it. Hopefully it'll help you.