Introduction
In this example, we will create a simple Ribbon using CSS.
Step 1: First we will create the main div, in which the ribbon will appear:

- <div class="main"></div>.main {
- margin: 0px auto;
- width: 400px;
- background-image: url('wooden2.jpg');
- -moz-border-radius: 10px;
- -khtml-border-radius: 10px;
- -webkit-border-radius: 10px;
- position: relative;
- z-index: 80;
- }
Here we set the background of the div and rounded corner using the radius property and set the z-index property (this property is useful to display the div under the ribbon).
Step 2: Now we will create a ribbon using the <div> tag like this:
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG, and XUL. From Wikipedia</p>
Here we will specify three div elements (the first one shows the front part of the ribbon, the second will show the left part and the third will show the right part of the ribbon).
First, we will set the property of the front part of the ribbon:
- <div class="main">
- <div class="ribbon"><h2 align="center" style="color:Tan;">CSS</h2></div>
- <div class="ribbon-left"></div>
- <div class="ribbon-right"></div>
- <div style="padding: 60px 25px 35px 25px;Color:wheat;">
- <div >
- <div class="ribbon"><h2 align="center"style="color:Tan;">CSS</h2></div>.ribbon {
- background-image: url('wooden1.jpg');
- height: 50px;
- width: 430px;
- -moz-border-radius: 2px;
- -moz-border-radius: 2px;
- -khtml-border-radius: 2px;
- -webkit-border-radius: 2px;
- position: relative;
- left: -15px;
- top: 40px;
- float: left;
- z-index: 100;
- }

Gowtham RajamanickamPosted Mar 13, 2015, 2:16 AM
great and simple...
Amit TripathiPosted Jul 16, 2014, 4:38 AM
nice article....
ayyappa gPosted Oct 31, 2013, 7:19 AM
nice article
Mahak GuptaPosted Jun 15, 2013, 1:45 PM
Thanks Isman and Narasimha
Narasimha MurthyPosted Jun 11, 2013, 5:30 AM
Good Article .., I get the Ribbon .., Thank u Gupta
Isman SubarkahPosted May 31, 2013, 12:30 PM
Nice article, finally i get an article about CSS Ribbon. Thank a lot Mahak.