Skip to main content

How to create CSS card 3d hover effect ?

  How to create CSS  card 3d hover effect ?




: SOURCE CODE :



HTML SOURCE_CODE:-


<html>
<head> 
<link href="style.css" rel="stylesheet">
</head>
<body >

<div class="wrapper">

    <div class="container"  id="c0">
        <div class="image" id="i0">
            
            <div class="city">
            

            </div>
        </div>
        <div class="story" id="s0">
            <div class="info">
            <h3>Bronu(The Dog)</h3>
            <p> The dog (Canis familiaris when considered 
a distinct species or Canis lupus familiaris when considered 
a subspecies of the wolf) is a domesticated carnivore of the family Canidae. 
It is part of the wolf-like canids, 
and is the most widely abundant terrestrial carnivore.</p>
            </div>
        </div>
    </div>
    <div class="container" id="c1">
        <div class="image" id="i1">
            <div class="city">
            
            </div>
        </div>
        <div class="story" id="s1">
            <div class="info">
                <h3>Mountain</h3>
            <p> A mountain is a large landform that rises above the
 surrounding land in a limited area, usually in the form of a peak.
 A mountain is generally considered to be steeper than a hill.
 Mountains are formed through tectonic forces or volcanism.</p>
            </div>
        </div>
    </div>
    <div class="container" id="c2">
        <div class="image" id="i2">
            <div class="city">
            
            </div>
        </div>
        <div class="story" id="s2">
            <div class="info">
            <h3>Camera
            </h3>
            <p> A camera is an optical instrument used to record images.
 At their most basic, cameras are sealed boxes (the camera body)
 with a small hole (the aperture) that allow light in to capture an 
image on a light-sensitive surface (usually photographic film or
 a digital sensor).</p>

            </div>
        </div>
    </div>

    <div class="page">
    <h4>Hover the card</h4>
    <ul><li> <<< </li>

    <li> >>> </li>
    </ul>
    </div>

</div>
    

</body>
</html>



CSS SOURCE_CODE:-



@import url('https://fonts.googleapis.com/css?family=Raleway:200');
body {
  font-family'Raleway'sans-serif;
  background:rgb(233233233);
  color#fff;
  transition1s;
}


.wrapper {
  positionabsolute;
  top10%;
  left40%;
  width300px;
  height500px;
  perspective900px;
  
}

.container {
  positionabsolute;
  top0%;
  width100%;
  height100%;
  transition.5s all ease;
  transformrotateX(60degscale(0.7);
  perspective900px;
  box-shadow0px 20px 50px #555;
  animation: entry 1s linear 1;
}

#c0 {
  positionabsolute;
  top0%;
  width100%;
  height100%;
  background-imageurl("img/dog-3204497_1920.jpg");
  background-sizecover;
  z-index300;
  box-shadow0 14px 28px rgba(0000.25), 0 10px 10px rgba(0000.22);
}


#c1 {
  background-imageurl("img/lorenzo-lamonica-i9QJqSIr4l4-unsplash.jpg");
  background-sizecover;
    box-shadow0 14px 28px rgba(3630300.25), 0 10px 10px rgba(0000.22);
  left100%;
  z-index0;
}


#c2 {
  left-100%;
  z-index0;
  background-imageurl("img/liam-shaw-ZGxjCKNEVtY-unsplash.jpg");
    background-sizecover;
    box-shadow0 14px 28px rgba(0000.25), 0 10px 10px rgba(0000.22);
}

.container:hover {
  cursorpointer;
  transformrotate(0degscale(1translateY(10px);
  transition.5s all ease;
  z-index400;
}

.image {
  positionabsolute;
  top0%;
  left0%;
  width100%;
  height45%;
 
}



    






.story {
  positionabsolute;
  top45%;
  left0%;
  height0%;
  width100%;
  backgroundlinear-gradient(to bottom#1f1e1e 0%#3f3e3d 40%);
  z-index30;
  transition0.5s;
}
 .container:hover .story{
  height55%;
  opacity0.90;
}
#s1 {
  backgroundlinear-gradient(to top#6eb42c 0%#4f8805 100%);
}

#s2 {
  backgroundlinear-gradient(to top#5d69d8 0%#7b88d1 120%);
}

.info  {
  positionrelative;
 opacity0;
 top:10%;
  overflowhidden;
  z-index100;
  transition1s;
}
 .container:hover .info{
  opacity1;
}

h3 {
  text-aligncenter;
  text-shadow0px 0px 10px #eee;
  color#eee;
  letter-spacing2px;
}

h4 {
  color#111;
  positionabsolute;
  top30%;
  left30%;
  letter-spacing2px;
}

h1 {
  color#111;
  positionfixed;
  top0%;
  left30%;
  letter-spacing2px;
}

p {
  font-size14px;
  color#fff;
  padding0px 20px 20px 20px;
  line-height150%;
  text-aligncenter;
  letter-spacing1px;
}

.page {
  positionabsolute;
  top0%;
  width100%;
  left0%;
  height20%;
  z-index30;
}

li {
  positionabsolute;
  top50%;
  list-stylenone;
  color#111;
}

li:nth-child(1) {
  left15%;
  animation: simple1 1s linear infinite;
}

li:nth-child(2) {
  right15%;
  animation: simple 1s linear infinite;
}

@keyframes simple {
  50% {
    transformtranslateX(10px);
    opacity0.5;
  }
  100% {
    transformtranslateX(10px);
    opacity0;
  }
}

@keyframes simple1 {
  50% {
    transformtranslateX(-10px);
    opacity0.5;
  }
  100% {
    transformtranslateX(-10px);
    opacity0;
  }
}

@keyframes entry {
  0% {
    top-20%;
    opacity0.1;
    transition1s;
  }
  100% {
    top0%;
  }
}



Definition and Usage


The :hover selector is used to select elements when you mouse over them.

Tip: The :hover selector can be used on all elements, not only on links.

Tip: Use the :link selector to style links to unvisited pages, the :visited selector to style links to visited pages, and the :active selector to style the active link.

Note: :hover MUST come after :link and :visited (if they are present) in the CSS definition, in order to be effective!



web design video




















Comments

Popular posts from this blog

How to create Page transition animation by Greensock (gsap)?

 Create Page transition animation by Greensock (gsap) https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js SOURCE CODE HTML  SOURCE_CODE:- index .html 👇 <! DOCTYPE   html > < html > < head >      < meta   charset = 'utf-8' >      < meta   http-equiv = 'X-UA-Compatible'   content = 'IE=edge' >      < title >  index Page  </ title >      < meta   name = 'viewport'   content = 'width=device-width, initial-scale=1' >      < link   rel = 'stylesheet'   type = 'text/css'   media = 'screen'   href = 'main.css' >      </ head > < body >      < div   class = "header" >          < a   href = "#" >         ...

How To Make A Website Using HTML CSS & JavaScript | Planets Website Design Full Video

artspider designerhttps://www.youtube.com/channel/UCD10SZSEyZCFAR4DFx_uNyg How To Make A Website Using HTML CSS & JavaScript | Planets Website Design Full Video SOURCE CODE HTML  SOURCE_CODE:- index .html 👇 <!DOCTYPE html> <html> <head>     <meta charset='utf-8'>     <meta http-equiv='X-UA-Compatible' content='IE=edge'>     <title>PlanetBook Home Page</title>     <meta name='viewport' content='width=device-width, initial-scale=1'>     <link rel='stylesheet' type='text/css' media='screen' href='style2.css'>      </head> <body>     <div class="header">         <a href="#" class="logo">             <img src="img/planetbooklogo.png" alt="">            </a>            <div class="loc">      ...

Car Website Design Using HTML , CSS and GSAP | Page transition animation by gsap | artspider

               https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js SOURCE CODE HTML  SOURCE_CODE:- index .html 👇 <! DOCTYPE   html > < html > < head >      < meta   charset = 'utf-8' >      < meta   http-equiv = 'X-UA-Compatible'   content = 'IE=edge' >      < title > page demo </ title >      < meta   name = 'viewport'   content = 'width=device-width, initial-scale=1' >      < link   rel = 'stylesheet'   type = 'text/css'   media = 'screen'   href = 'style2.css' >    </ head > < body >      < div   class = "logo" >< p   id = "logoT" > CARO </ p ></ div >      < div   class = "cover" > < div   class = "maindi...