FF10 shows the top ribbon-fold encroaching about 1px on top of the wrapper, but I can’t seem to figure out why… Seems like adding bottom: -2px; to the .ribbon-green:before declaration makes it mostly look right, but I can’t quite tell..
Very nice approach. I despise having to use images for things like this. Hopefully MS kills off everything pre IE9 soon so we can more effectively use things like this.
this looks very bad in IE. doesn’t look like a ribbon. it’s a square and it moves down my entire page (nav menu, feature box, etc) 3/4 of the way down the page. looks good in ff and chrome though.
This is a cool effect and anything with no images is your friend!
Eh, who cares about IE anyways? M$ should just suffer for thinking it’s the only entity in the whole universe when its not!
One thing in the example that would be nice is if the math could have been included. I can wiggle it around and get the right settings using firebug but would much rather busting out a calculator and getting the exacts!
Just implimented this today in an e-commerce store project. Depending on the ribbon class, the colors change: RENTAL, ON SALE, NEW, etc. Once again, thanks, Chris!
This is insane. I know how to use pseudo classess, gradient, opacity, shadow… and thought I knew css3.
Now looking at your code, I know that I know nothing.
Thanks for sharing!!!
Thanks a lot for you piece of code ! It really helped me ! I started making a ribbon with image, but when I saw your code and tried it, I changed my mind !
FF10 shows the top ribbon-fold encroaching about 1px on top of the wrapper, but I can’t seem to figure out why… Seems like adding
bottom: -2px;to the.ribbon-green:beforedeclaration makes it mostly look right, but I can’t quite tell..So much more flexible than using a static image. Super handy for such a commonly used design element. Very cool!
Very nice approach. I despise having to use images for things like this. Hopefully MS kills off everything pre IE9 soon so we can more effectively use things like this.
Very nice approach. Thank you.
@jordan
I get the px encroach too – in IE9, Chrome 17 & FF 11.
To get rid of the top pixel encroach – here’s what worked for me:
.ribbon-wrapper-green
Change top: -3px; to top: -5px;
Pixel begone!!
this looks very bad in IE. doesn’t look like a ribbon. it’s a square and it moves down my entire page (nav menu, feature box, etc) 3/4 of the way down the page. looks good in ff and chrome though.
thats very nice, thanks !
Thanks Its Amzing
Looks verry nice in all newer Webkit Browser and IE 9. All the other IE Versions doesn’t support this script. =( IE is such a bad thing -.-
This is really nice. I’ll use it soon, who cares about the IE-User :-)
This is a cool effect and anything with no images is your friend!
Eh, who cares about IE anyways? M$ should just suffer for thinking it’s the only entity in the whole universe when its not!
One thing in the example that would be nice is if the math could have been included. I can wiggle it around and get the right settings using firebug but would much rather busting out a calculator and getting the exacts!
Please? b^.^d
beautiful, that was what I needed :)
How can I make the ribbon an active link?
The easiest way to do that would be just to add an `` tag to the ribon. Like this:
`NEWS`
Sorr about that. View it Here.
thanks.. it is very easy to implement :)
Just implimented this today in an e-commerce store project. Depending on the ribbon class, the colors change: RENTAL, ON SALE, NEW, etc. Once again, thanks, Chris!
Hello,
How to adapt it on each corners ? I tried to modify the CSS to put the ribbon on top left corner but without any results :(
Any idea ?
Thanks for this nice CSS.
Fab
@Fab: Did you work this out? If so, please share your code. I would also like to know how to put it in the top left corner.
Any luck?
Thanks for this Chris.. Much appreciated..
WOAH!! thats almighty Lovely..Thanx
How do you go about making it bigger?
How to make the ribbon on top left corner?
where to set the html in wordpress?*new in wordpress
I use the style like this to set it to the left
< div class=”ribbon-wrapper-blue”>
< div class=”ribbon-blue”>
My Text
< /div>< /div>
.ribbon-wrapper-blue {
}
.ribbon-blue {
}
I made a smaller sale version in red that is left-aligned. Enjoy :)
.ribbon-wrapper-red { width: 100px; height: 100px; overflow: hidden; position: absolute; top: -6px; left: -6px; } .ribbon-red { font-size: 13px; color: white; text-align: center; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); position: relative; padding: 2px 0; left: -21px; top: 8px; width: 82px; background-color: #BFDC7A; background-image: -webkit-gradient(linear, left top, left bottom, from(#990000), to(#cc0000)); background-image: -webkit-linear-gradient(top, #990000, #cc0000); background-image: -moz-linear-gradient(top, #990000, #cc0000); background-image: -ms-linear-gradient(top, #990000, #cc0000); background-image: -o-linear-gradient(top, #990000, #cc0000); -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3); -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3); box-shadow: 0px 0px 3px rgba(0,0,0,0.3); } .ribbon-red:before, .ribbon-red:after { content: ""; border-top: 3px solid #900; border-left: 3px solid transparent; border-right: 3px solid transparent; position: absolute; bottom: -3px; } .ribbon-red:before { left: 0; } .ribbon-red:after { right: 0; }This is insane. I know how to use pseudo classess, gradient, opacity, shadow… and thought I knew css3.
Now looking at your code, I know that I know nothing.
Thanks for sharing!!!
Thanks a lot for you piece of code ! It really helped me ! I started making a ribbon with image, but when I saw your code and tried it, I changed my mind !
Thanks again !