Design a Frosted Glass Effect using HTML and CSS Last Updated : 04 Jun, 2024 Comments Improve Suggest changes Like Article Like Report In this article, we will implement a frosted glass effect using the bootstrap 4 card class. The below image is the final output that you will get as the final result of this article. Approach: 1. Styling the body: Let's first set the background for your webpage. Write the below code under your head tag inside your <style> tag. If you have already set your background property (which you would have) then skip to the next section. If not, here you go. CSS body { background-image: url('background.jpg'); background-repeat: no-repeat; background-size: 100%; background-attachment: fixed; } You can read about the above properties here 2. Frost glass card: Under the style tag, use the following code, CSS .card { box-shadow: 0 0 5px 0 ; background: inherit; backdrop-filter: blur(10px); <!--margin: 100px; according to your need--> } So what do we have here, box-shadow: This property is used to give a shadow-like effect to the frames of an element.background: Use this to make the element transparent and have the same background as your webpage (in the body class its necessary to have "background-attachment: fixed,")backdrop-filter: Use this to apply effects to the area behind an element. (Read this as well) Basically, this is the property that is reducing a lot of CSS styling here.margin: Margin and padding are according to your need.Note: There have been issues with Mozilla's browser Firefox and in cases, the backdrop-filter doesn't work properly, chrome and edge work fine. 3. <div> in body: HTML <body> <div class="container"> <div class="card card-body" style="justify-content: center;"> <!--Contents <h1 >_______</h1> --> </div> </div> </body> Final Code: HTML <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href= "https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <style> body { background-image: url( "https://media.geeksforgeeks.org/wp-content/uploads/20200318142240/Bootstrap5.png"); background-repeat: no-repeat; background-size: 100%; background-attachment: fixed; } h1 { color: white; height: 250px; display: flex; justify-content: center; align-items: center; } .card { top: 50%; box-shadow: 0 0 5px 0; background: inherit; backdrop-filter: blur(10px); margin: 100px; text-align: center; } </style> </head> <body> <div class="container"> <div class="card card-body" style="justify-content: center;"> <h1>GeeksforGeeks</h1> </div> </div> </body> </html> Output: Comment More infoAdvertise with us Next Article Design a Frosted Glass Effect using HTML and CSS K kumar0rishav Follow Improve Article Tags : Technical Scripter Web Technologies Web Templates Technical Scripter 2020 Similar Reads 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 How to Design Stitched Glowing Effect for Button using HTML and CSS ? The stitched glowing effect is generally used in the design of classical or retro-themed websites. You can also call it a Denim effect if you use blue color for the effect as it looks similar to the classic original denim. It is one of the best effect to understand the concept of radial-gradient and 1 min read Design a Image Hover Effect Color Transition template using HTML and CSS The article uses HTML and CSS to create the template for an Image Hover Effect with Color Transition. This template adds an interactive element to your web design by smoothly transitioning colors when users hover over an image. You can create a dynamic effect that enhances visual engagement by utili 2 min read Design a Overlap Block Page Template using HTML and CSS In this article, we will create an Overlap Block layout template using HTML & CSS. The Overlap Block Layout is a design concept where multiple elements or blocks on a webpage visually overlap with one another. This layout frequently uses CSS's z-index property to regulate the order in which item 3 min read Design a Offer Box With Ribbon template using HTML and CSS 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 serve 3 min read Like