Open In App

How to Create Glassmorphism Effect?

Glassmorphism is a very trendy and modern design style that is being used at various interfaces around the world. It is mostly used to add depth to the interfaces and promote new things while also giving a premium look to the interface. In this article, we will see What is Glassmorphism? Its characteristics, How to make a Glassmorph with an example.

glassmorphism

Glassmorphism Effect

What is Glassmorphism?

Glassmorphism is a type of styling that as its name suggests looks like a glass. Different parts of a design are made and placed in such a way that it looks like we are looking at something through a glass. It gives the design a translucent look which looks very modern and premium. It gives the design a blurry effect. Using a colorful background with a Glassmorphism effect makes the content more noticeable. We use this to create a hovering Glass to blur certain parts of a design so that the focus can be shifted elsewhere. It can also be used to hold icons or menu options. It provides a modern and sleek look to the interface. It creates a visual hierarchy among the elements by giving them a look that they are placed on top of each other.

Characteristics of Glassmorphism

How to Create Glassmorphism?

These are the steps to make a CSS Glassmorphism:

  1. Use an Evocative Background which contains geometric shapes or gradients.
  2. Apply opacity to the Glassmorph card.
  3. Blur the background of the Glassmorph card using backdrop-filter CSS property.
  4. Add Radius and Border to the Glassmorph card.

Example: In this example, we will create an animated Glassmorphism effect using HTML and CSS.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
    <title>Glassmorphism</title>
    <style>
        .background{
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #card{
            position: absolute;
            height: 40%;
            width: 20%;
            border: 1px solid rgba( 255, 255, 255, 0.18 );
            background: rgba(89, 131, 83, 0.09);
            backdrop-filter: blur( 2px );
            border-radius: 1em;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.8s;
        }
        #card:hover{
            backdrop-filter: blur( 14px );
            height: 50%;
            width: 25%;
            transform: rotateY(180deg);
        }
        #logo{
            height: 70%;
            width: 65%;
        }
    </style>
</head>
<body>
    <div class="background">
        <img src=
"https://media.geeksforgeeks.org/wp-content/uploads/20231207160829/glass-bg-2.webp">
        <div id="card">
           <img id="logo" src=
"https://media.geeksforgeeks.org/wp-content/uploads/20231207115905/GFG_LOGO-removebg-preview.png">
        </div>
    </div>
</body>
</html>

Output:

Untitled-video---Made-with-Clipchamp-(1)

Glassmorph

Tips to Create the Best Glassmorphism

Conclusion

Glassmorphs are very useful for the users by giving the interfaces a modern and sleek look. Glassmorphs are usually used to highlight an element or give certain content a sense of depth which helps the brand to promote new things while giving users a very appealing look that has a very premium feel to it. Using an appropriate amount of blur on the glassmorph gives it a 3D look which makes certain content stand out. Glassmorph is great way to promote new things or to let people now about a new service. Glassmorph is a modern and trendy approach that should be used when making interfaces.

Article Tags :