Design a Offer Box With Ribbon template using HTML and CSS Last Updated : 24 Jul, 2024 Comments Improve Suggest changes Like Article Like Report 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. PreviewApproachFirst 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 /* style.css */ body { font-family: 'Arial', sans-serif; margin: 40px; padding: 0; display: flex; justify-content: center; height: 100vh; background: linear-gradient(to right, #64f388, #51a3e6); } h1 { color: rgb(9, 131, 9); text-align: center; margin-bottom: 30px; font-size: 35px; } .offer-box { padding: 10px; position: relative; width: 500px; height: 500px; background-color: #fff; border: 1px solid #ddd; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); border-radius: 20px; } .box { height: 100%; display: flex; align-items: center; justify-content: center; } .content { height: 80%; width: 80%; padding: 20px; text-align: center; font-size: large; font-weight: 800; background: linear-gradient(to right, #424140, #232463); border-radius: 10px; position: relative; display: grid; place-items: center; } h2 { color: #f508a6; margin-bottom: 10px; font-size: 40px; text-shadow: 2px 3px 5px #ff0000, 3px 5px 10px #0000ff; } h2:hover { font-size: 45px; margin-top: 30px; } h3 { color: #37fd10; margin: 5px; font-size: 25px; } h3:hover { font-size: 30px; margin-top: 10px; text-shadow: 1px 1px 10px #f04a9d; } p { margin-top: 0px; color: #e2d2d2; font-size: larger; } .btn { padding: 10px 20px; font-family: Arial, Helvetica, sans-serif; font-size: 20px; background-color: #ec3169da; font-weight: 800; border-radius: 20px; color: white; border: 2px solid rgb(187, 3, 73); } .btn:hover { background-color: #e61855; box-shadow: 0px 0px 0px 2px rgba(238, 40, 116, 0.911); } .ribbon-wrap { width: 150px; height: 150px; overflow: hidden; position: absolute; top: -10px; left: -10px; } .ribbon-wrap::before, .ribbon-wrap::after { content: ''; width: 10px; height: 10px; background: #e61855; position: absolute; z-index: -1; } .ribbon-wrap::before { top: 0; right: 5px; } .ribbon-wrap::after { bottom: 5px; left: 0; } .ribbon { width: 225px; font-size: 22px; font-weight: 800; text-align: center; padding: 8px 0; background: #333; color: #f70b52; position: absolute; transform: rotate(-45deg); padding-left: 5px; left: -40%; top: 25%; } .btn:hover, .ribbon:hover { animation: glow 1s infinite alternate; } @keyframes glow { 0% { box-shadow: 0 0 10px #e6187f; } 100% { box-shadow: 0 0 20px #f30930; } } Output:output Comment More infoAdvertise with us Next Article Design a Cookies Message Popup Template using HTML and CSS J jaykush Follow Improve Article Tags : Web Technologies Geeks Premier League Web Templates Geeks Premier League 2023 Similar Reads Design a Cookies Message Popup Template using HTML and CSS In this article, we will design a Cookies Message Popup template using HTML and CSS. Cookies play a pivotal role in enhancing user experiences on websites by storing information about user preferences and interactions. The "Cookies Message Popup Template" is a simple and customizable solution for we 3 min read Design a Layered Image Page Template using HTML and CSS The article provides a complete guide for creating a layered image layout using HTML and CSS. The Layered Image Page refers to a webpage design that contains layered structured visual elements using images. Here, the design contains two boxes with background images and some empty rounded boxes with 3 min read Design a Wedding Theme based Page using HTML and CSS Designing a wedding-themed webpage is a fun way to capture the joy of this special day. In this article, we'll help you create a beautiful webpage using simple HTML and CSS.PreviewApproachFirslty, create a new file with the "index.html". Include Google Fonts, Font Awesome Icons, and external CSS lin 6 min read Design a Google Chrome Page Template using HTML and CSS Google Chrome Page Template is a replica of Google Chrome Page which can be built with the help of HTML and CSS. This project has fundamental features and design elements, a search option, along with using the FontAwsome Icons, and various CSS styling, which offer you hands-on experience in web desi 4 min read Design a Responsive Services Section Template using HTML and CSS A Services Website plays a vital role in showcasing the different services that a particular company or any other contractor has to offer. In this article, we are going to build a services page, it will illustrate the different components of the services like the title, description, and learn more b 4 min read Design a Virtual Credit Card Template using HTML and CSS In this article, we will design a Virtual Credit Card template using HTML and CSS for a modern and interactive user experience. This design includes spaces for the card number, name, and expiry date. HTML will be used to structure the layout, while CSS will add styling for a visually pleasing and be 3 min read Like