hello, I would like to know how can I create css bookmark ribbon horizontally aligned with text? Here is the example screenshot
Any example custom CSS or bootstrap solution or tutorial link for this, thanks.
You can use the below CSS for creating horizontal bookmark ribbon
.bookmarkRibbon {
width: 105px;
height: 0;
border-bottom: 20px solid #045089;
border-top: 20px solid #045089;
border-left: 15px solid transparent;
float: right;
margin-bottom: 20px;
font-size: 17px;
font-weight:700;
position: absolute;
right: 0px;
top: 20px;
}
HTML
<div class="bookmarkRibbon"><span style="color:white;position: relative;top: -9px;text-align: center;right: -10px;">20% OFF</span></div>
Here is the working fiddle for you to test.
Above answer is perfect, but if you need right-side ribbon without text, then you can have CSS
.cssRibbon{
border: 50px solid blue; /* All borders set */
border-left: 0; /* Remove left border */
border-right: 30px solid transparent; /* Right transparent */
width: 100px; /* Increase element Width */
}
HTML
<div class="cssRibbon"></div>
here is fiddle demo: https://jsfiddle.net/gqvb869t/
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly