How to Create Ribbon using CSS

In this tutorial i am going to explain how to create Ribbon using CSS. While you working of any project and design webpage there may it is required to design logo of product and if you want want to design logo with ribbon so you can create ribbon by using css style. Now i am working on one of the live project of North Star School and i got same requirement to design logo of school with ribbon and use logo in to website.

So, Let's Create one HTML page to Demonstration Purpose:
 First You need to write css in between <style> tag within <head> tag.
After complete css you need to apply css class in to html control just like :

HTML Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style>
        .ribbon {
            font-size16px !important;
            width300px;
            positionrelative;
            background#C50F0F;
            color#fff;
            text-aligncenter;
            padding1em 2em;
            margin2em auto 3em;
        }
 
            .ribbon:before.ribbon:after {
                content"";
                positionabsolute;
                displayblock;
                bottom-1em;
                border1.5em solid #B41111;
                z-index-1;
            }
 
            .ribbon:before {
                left-2em;
                border-right-width1.5em;
                border-left-colortransparent;
            }
 
            .ribbon:after {
                right-2em;
                border-left-width1.5em;
                border-right-colortransparent;
            }
 
            .ribbon .ribbon-content:before.ribbon .ribbon-content:after {
                content"";
                positionabsolute;
                displayblock;
                border-stylesolid;
                border-color#804f7c transparent transparent transparent;
                bottom-1em;
            }
 
            .ribbon .ribbon-content:before {
                left0;
                border-width1em 0 0 1em;
            }
 
            .ribbon .ribbon-content:after {
                right0;
                border-width1em 1em 0 0;
            }
 
        .non-semantic-protector {
            positionrelative;
            z-index1;
        }
    </style>
</head>
<body>
    <div class="non-semantic-protector">
        <h1 class="ribbon">
            <strong class="ribbon-content">WWW.ASPPOINT.COM</strong>
        </h1>
        <center>
            <p>Developed By: Nikunj Satasiya</p>
            <br />
            <p>
                Copyright © 2016 asppoint.com All Right Reserved.
            </p>
        </center>
     </div>
</body>
</html>
Demo:
Ribbon CSS Example
Download Sample Code:

Download Sample Code


Previous
Next Post »

If you have any kind of question about any post, Feel free to ask.You can simply drop a comment below post. Your feedback and suggestions will be highly appreciated. ConversionConversion EmoticonEmoticon