http://jsfiddle.net/6HyjZ/
.bookmarkRibbon{
width:0;
height:100px;
border-right:50px solid blue;
border-left:50px solid blue;
border-bottom:30px solid transparent;
}
<div class="bookmarkRibbon"></div>
I'm struggling to make a version of this shape where the ribbon is pointing right instead of down, how can I achieve this?
Arrows. To create a simple arrow without a tail, make a box with a width and height, border, as well as zero left and top borders. To make an up arrow, add the transform: rotate(225deg); property, and to make a down arrow, add the transform: rotate(45deg); property to rotate the arrow to 225 and 45 degrees respectively ...
To help you visualize the logic step-by-step
so you can apply it easily on ANY SIDE you desire:
.bookmarkRibbon {
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 */
}
<div class="bookmarkRibbon"></div>
Using the helpful accepted answer here is it with text version.
Vertical(Top to bottom) Banner with text
.ribbon-vertical {
position: absolute;
right: 10px;
border: 13px solid #e46a76; /* All borders set */
border-top: 0; /* Remove left border */
border-bottom: 10px solid transparent; /* Right transparent */
height: auto; /* Increase element Width */
width: 0;
word-wrap: break-word;
color: white;
z-index: 1;
-webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}
.ribbon-vertical div{
position: relative;
right: 5px;
padding-top: 2px;
padding-bottom: 2px;
}
<div class="ribbon-vertical"><div>BANNER</div></div>
Horizontal(Right to Left) Banner with text
.ribbon-horizontal{
position: absolute;
right: 0;
bottom: 5rem;
border: 13px solid #e46a76;
border-right: 0;
border-left: 10px solid transparent;
height: 0;
line-height: 0;
width: 100px;
color: white;
z-index: 1;
-webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
letter-spacing: 3px;
}
.ribbon-horizontal span{
position: relative;
padding: 0 4px 0 10px;
text-align: center;
}
<div class="ribbon-horizontal"><span>BANNER</span></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With