How to create CSS Bookmark ribbon horizontally with text?


hello, I would like to know how can I create css bookmark ribbon horizontally aligned with text? Here is the example screenshot

css-boookmark-ribbon-how-to-generate.png

Any example custom CSS or bootstrap solution or tutorial link for this, thanks.


Asked by:- manish
0
: 167 At:- 8/17/2018 1:00:20 PM
CSS css horizontal ribbon






1 Answers
profileImage Answered by:- jon

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.

2
At:- 8/20/2018 3:33:40 PM
Excellent answer, thank you 0
By : manish - at :- 8/25/2018 2:22:40 PM





Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly