Open In App

Design a Offer Box With Ribbon template using HTML and CSS

Last Updated : 24 Jul, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

To highlight special offers, discounts, or promotions, offer boxes with ribbons are a common graphic element seen in marketing and promotional materials. Usually, it is just a box or container with the offer inside that is decorated with ribbon to make it look festive and appealing. The ribbon serves as a design element to highlight the promotional nature of the content and make it stand out. In this article, we will create a visually appealing Offer Box with a ribbon positioned at the top-right corner.

Preview

rt

Approach

  • First create a main container with class offer-box, and it contains divs for content, sale, and ribbon.
  • Write concise CSS rules for body, headings, offer box, button, and ribbon, incorporating gradients and hover effects.
  • Choose a font-family, set styles for the heading and content, and add subtle text shadows.
  • Style the button and ribbon, adding animations for hover effects using pure CSS.

Example: In this example, we will design an Offer Box with a ribbon using HTML and CSS.

HTML
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width,
                   initial-scale=1.0">
    <link rel="stylesheet" 
          href="style.css">
</head>

<body>
    <div>
        <h1> GeeksForGeeks </h1>
        <div class="offer-box">
            <div class="box">
                <div class="content">
                    <h2>Special Offers</h2>
                    <h3> Get 20 - 40% off</h3>
                    <p> 
                      DSA SELF-PACED COURSE <br> Limited time offer!
                      </p>
                    <img src="1.png" height="50px" 
                         width="150px" alt="">
                    <button class="btn">
                      Claim Offer
                      </button>
                </div>

                <div class="ribbon-wrap">
                    <div class="ribbon">
                      Offer 20%
                      </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
CSS

Output:

t11-ezgifcom-resize
output

Next Article

Similar Reads

three90RightbarBannerImg