Can someone please tell me the CSS code or point me to a tutorial on how to achieve this effect see all the time. Here is a image of what I'm talking about:
Note: I know how to position with absolute I just need to know how they pull the effect off.
If the ribbon is the issue, then use borders on an empty (0-size) element (which you can add with :after
pseudo-element)..
Html
<div id="content">
<div id="ribbon"></div>
</div>
CSS
#content{
background-color:#77c;
width:300px;
height:200px;
position:relative;
}
#ribbon{
position:absolute;
width:80px;
height:30px;
right:-20px;
top:50px;
background-color:#999;
}
#ribbon:after{
content:'';
width:0;
height:0;
border-color: transparent transparent #666 #666;
border-style:solid;
border-width:5px 10px;
position:absolute;
right:0;
top:-10px;
}
Demo at http://jsfiddle.net/gaby/zJPhy/
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