How to create UI designed glassmorphic cards
Creating UI designed glassmorphic cards with vannila-tilt effect
Note : OUTPUT IS AT THE END OF THE CODE .DONT MISS
Hello guys.I have been here today with another dynamic article about creating UI designed GLASSMORPHIC CARDS using Html and Css. It's really simple by following this tutorial.
Here these are the steps to get the correct result .plz follow the steps one by one
Step 1- first of all write the basic code of html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
Step 2 - we have to write the html code for creating cards
<div class="main">
<div class="profilecards">
<div class="overview">
<img height="65px" width="65px" src="E:\☻DINESH IMP☻\html css/download.jpg" alt="" class="img">
<h3>wiliard johns</h3>
<p>hello guys !welcome to Mr.unofficial blog here im goig to create a glassmorphic card effect using html and css</p>
<a href="#">read more</a>
</div>
</div>
</div>
After certain the card ,copy the card data and paste two times because we are going to create 3 cards.Now the total html code looks like this given below.
<body>
<div class="main">
<div class="profilecards">
<div class="overview">
<img height="65px" width="65px" src="E:\☻DINESH IMP☻\html css/download.jpg" alt="" class="img">
<h3>wiliard johns</h3>
<p>hello guys !welcome to Mr.unofficial blog here im goig to create a glassmorphic card effect using html and css</p>
<a href="#">read more</a>
</div>
</div>
<div class="profilecards">
<div class="overview">
<img height="65px" width="65px" src="E:\☻DINESH IMP☻\html css/download.jpg" alt="" class="img">
<h3>antony williams</h3>
<p>hello guys !welcome to Mr.unofficial blog here im goig to create a glassmorphic card effect using html and css</p>
<a href="#"> read more</a>
</div>
</div>
<div class="profilecards">
<div class="overview">
<img height="65px" width="65px" src="E:\☻DINESH IMP☻\html css/download.jpg" alt="" class="img">
<h3>sergio marconi</h3>
<p>hello guys !welcome to Mr.unofficial blog here im goig to create a glassmorphic card effect using html and css</p>
<a href="#"> read more</a>
</div>
</div>
</div>
</body>
Step 3- Now we have to write the css code to design the background.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
justify-content: center;
align-items: center;
display: flex;
min-height: 100vh;
background: #050505;
color: #fff;
}
Now I'm going to create two gradient coloured semi circles at the edges of the webpage.So for that we have to consider the body and write the "before" attributions to the code as shown below .
body::before {
content: '';
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
background: linear-gradient( #EE7752, #23A6D5, #e71034);
clip-path: circle(20% at right 70%);
}
body::after {
content: '';
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
background: linear-gradient(#e71034, #23A6D5);
clip-path: circle(20% at left 30%);
}
.main {
align-items: center;
justify-content: center;
position: relative;
display: flex;
flex-wrap: wrap;
z-index: 1;
max-width: 1200px;
}
Next we have to write the code for the sub division named Profile cards .
.main .profilecards {
position: relative;
width: 220px;
height: 350px;
margin: 30px;
background: rgba(225, 225, 225, 0.1);
overflow: hidden;
justify-content: center;
align-items: center;
border-left: 1px solid rgba(225, 225, 225, 0.5);
border-top: 1px solid rgba(225, 225, 225, 0.5);
backdrop-filter: blur(5px);
border-radius: 10px;
}
Now I'm going to write some code for the 2nd sub division which I have named it as overview.Here I'm aligning the content to center and making the transition to 5sec.
.overview {
padding: 20px;
text-align: center;
justify-content: center;
transition: 0.5s;
}
Now i have styled a few small things like img,head tags,paragraph and link tags, as shown below.
.img {
border-radius: 50%;
margin-top: 30px;
}
h3 {
font-size: 18px;
text-transform: uppercase;
z-index: 1;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
p {
font-size: 14px;
font-weight: 100;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
a {
color: rgba(255, 255, 255, 0.521);
position: relative;
display: inline-block;
padding: 5px;
margin-top: 15px;
background: linear-gradient(to left, #E73c7E, #23A6D5);
border-radius: 5px;
text-decoration: none;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
Now I'm going to design the hover effect to the cards in which the hover effect just looks like amazing.When we hoovered on the card the user information comes up with a transition.Its really looks amazing .
No comments: