What we bring to you today is to use CSS3 technology to achieve the mouse through the picture, showing the animation effect of the picture description. When the mouse passes through the picture, the picture animation shrinks and the gradient displays a description. Let's see it together:
Online preview Source Download
Let's learn the code for this case together.
HTML code:
<DivAlign= "Center"> <Divclass= "Carre_couleur Base_hov"style= "Background-color: #f8b334;"> <aTarget= "_blank"href= "Http://www.w2bc.com"> <Divclass= "Retract"style= "Background-color: #f8b334;"> <imgsrc= "Img/1.png"></Div> <Divclass= "acced"> <Divclass= "big_acced"style= "color: #f39c12;">Best HOME</Div> <Divclass= "middle_acced">This home was the best</Div> </Div> </a> </Div> <Divclass= "Carre_couleur Base_hov"style= "Background-color: #2ecc71;"> <aTarget= "_blank"href= "Http://www.w2bc.com"> <Divclass= "Retract"style= "Background-color: #2ecc71;"> <imgsrc= "Img/2.png"></Div> <Divclass= "acced"> <Divclass= "big_acced"style= "color: #27ae60;">Best PIC</Div> <Divclass= "middle_acced">This pic was the best</Div> </Div> </a> </Div> <Divclass= "Carre_couleur Base_hov"style= "Background-color: #e74c3c;"> <aTarget= "_blank"href= "Http://www.w2bc.com"> <Divclass= "Retract"style= "Background-color: #e74c3c;"> <imgsrc= "Img/3.png"></Div> <Divclass= "acced"> <Divclass= "big_acced"style= "color: #c0392b;">Best PC</Div> <Divclass= "middle_acced">This computer are the best</Div> </Div> </a> </Div>
View Code
CSS3 Code:
. Carre_couleur{width:200px;Height:200px;Display:Inline-block;position:relative;Margin-top:0px; }. Base_hov. Retract{-webkit-transition:All 200ms ease-in;-webkit-transform-origin:50% 20%;-webkit-transform:Scale (1);-moz-transition:All 200ms ease-in;-moz-transform-origin:50% 20%;-moz-transform:Scale (1);-ms-transition:All 200ms ease-in;-ms-transform-origin:50% 20%;-ms-transform:Scale (1);transition:All 200ms ease-in;Transform-origin:50% 20%;Transform:Scale (1);width:200px;Height:200px;position:Absolute;Z-index:2; Left:0; }. Base_hov:hover. Retract{-webkit-transition:All 200ms ease-in;-webkit-transform:Scale (0.6);-moz-transition:All 200ms ease-in;-moz-transform:Scale (0.6);-ms-transition:All 200ms ease-in;-ms-transform:Scale (0.6);transition:All 200ms ease-in;Transform:Scale (0.6); }. acced{width:180px;padding:10px;Bottom:0;position:Absolute;Z-index:1;text-align: Left; }. big_acced{Color:#ffffff;font-size:25px;Font-weight: -; }. middle_acced{Color:#ffffff;font-size:15px;Font-weight: -; }
View Code
Copy the above code into your HTML and try the results.
Note: This article Love programming original article, reproduced please specify the original address: http://www.w2bc.com/Article/5582
Pure CSS3 Mouse After picture display description effect