Skip to main content

Create Cool Hover Effects for Cards with HTML & CSS (2024)

 




Learn how to create stylish hover effects for cards using HTML and CSS in this tutorial. Watch step-by-step as we implement eye-catching animations to make your website's cards stand out. Perfect for web developers looking to enhance user experience and add a touch of interactivity to their projects. Get ready to impress with cool hover effects for cards! 
Stay tuned for more web development tutorials.

index.html 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Card</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="card">
        <img src="Image/paris_eiffeltower_ssk500.jpeg" alt="EiffelTower">
        <div class="card-content">
            <h1 class="title">Eiffel Tower</h1>
            <p class="sub-title">Tower in Paris, France
            </p>
            <p class="text">The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower from 1887 to 1889</p>
             <button class="card-button">Visit More</button>
        </div>
    </div>
</body>
</html>

style.css

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Times New Roman', Times, serif;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgb(30, 63, 113);
    height: 100vh;
    width: 100%;
}
.card{
    height: 500px;
    width: 350px;
    border: 5px solid black;
    border-radius: 25px;
    position: relative;
    overflow: hidden;
}
.card img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius:20px ;
}
.card-content{
    width: 100%;
    height: 100%;
    position: absolute;
    right:-100%;
    top: 0;
    background-color: rgb(22, 65, 100);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    transition: 0.5s;

}
.card:hover .card-content{
    right: 0;
}
.title{
font-size: 1.8em;
color: white;
text-align: center;
}
.sub-title{
font-size: 1.5em;
color: antiquewhite;
text-align: center;
}
.text{
color: aqua;
padding-top: 25px;
text-align: center;
font-size: 1.2em;
}
.card-button{
color:white ;
background:rgb(16, 35, 64) ;
margin: 35px 80px;
padding: 10px;
border-radius: 10px;
font-size: 1.1em;
cursor: pointer;
}






















Comments

Popular posts from this blog

How to Build Your Own Image Uploader using HTML, CSS, and JS Tutorial

    Welcome to our step-by-step tutorial on creating your own image uploader using #html  , #css  , and JavaScript. In this video, we'll guide you through the process of building a simple yet effective image uploader for your web projects. With just a few lines of code, you'll learn how to create a user-friendly interface that allows users to upload images seamlessly. Whether you're a beginner or an experienced developer looking to enhance your skills, this tutorial is perfect for you. Follow along and empower yourself to create dynamic web applications with ease! Don't forget to like, share, and subscribe for more coding tutorials. Let's get started!  index.html   <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Drag & Drop Image Uploader </ title >...

Create an Animated Switch with HTML and CSS in 2024

  Create an Animated Switch with HTML and CSS in 2024 Learn how to create an animated switch using HTML and CSS in 2024! This tutorial will guide you through the process of building a sleek and modern switch element for your website. Enhance your web development skills and stay up-to-date with the latest design trends by mastering this technique. Watch now to level up your front-end development game!  index.html  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Document </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < label class = "switch" >         < input type = "checkbox" checked = "checked" >         < div class = "button" >  ...

Animated Switch

    index.html <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Document </ title >     < link rel = "stylesheet" href = "style.css" > </ head > < body >     < label class = "switch" >         < input class = "cb" type = "checkbox" />         < span class = "toggle" >           < span class = "left" > off </ span >           < span class = "right" > on </ span >         </ span >       </ label >       </ body > </ html > style.css  /* The switch - the box around the slider */ .switch {     font-size : 17px ; ...