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?
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>
.bookmarkRibbon{
width:100px;
height:0;
border-bottom:50px solid blue;
border-top:50px solid blue;
border-right:30px solid transparent;
}
If you 'rotate' the css properties, it rotates the form by 90 degrees.
.bookmarkRibbon{
width:100px;
height:0;
border-bottom:50px solid blue;
border-top:50px solid blue;
border-left:30px solid transparent;
}
http://jsfiddle.net/6HyjZ/6/
Use transform:rotate
:
.bookmarkRibbon{
width:0;
height:100px;
border-right:50px solid blue;
border-left:50px solid blue;
border-bottom:30px solid transparent;
transform:rotate(7deg);
-ms-transform:rotate(7deg); /* IE 9 */
-webkit-transform:rotate(7deg); /* Opera, Chrome, and Safari */
}
Just swap what you have and you are good to go jsfiddle:
.bookmarkRibbonRight{
width:100px;
height:0px;
border-right:30px solid transparent;
border-bottom:50px solid blue;
border-top:50px solid blue;
}
You already have the shape, just use the transform property to change its angle.
Here is the code that I have added to the code you have.
transform: rotate(270deg);
Here is the fiddle, http://jsfiddle.net/6HyjZ/11/ It now points to the right (unless that's right right side)
Use the rotate
css transform:
.bookmarkRibbon{
width:0;
height:100px;
border-right:50px solid blue;
border-left:50px solid blue;
border-bottom:30px solid transparent;
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}
http://jsfiddle.net/6HyjZ/13/