Let a group of images zoom in and out-CSS mode, zoom in and out-css
Applicable browsers for this instance: 360, FireFox, Chrome, Safari, Opera, aoyou, sogou, and windows of the world. IE8 and below are not supported.
Set the source code to image-01.jpg and image-02.jpg in the front directory.
The source code of index.html is as follows:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "UTF-8"/>
<Title> CSS3: hover the mouse over and zoom in the photo wall-Webmaster Material </title>
<Link rel = "stylesheet" type = "text/css" href = "style.css">
</Head>
<Body>
<P>
Test browser compatibility: ie9 +, chrome, FF, safari;
</P>
<Ul class = "polaroids">
<Li> <a href = "#" title = "Roelan"> </A> </li>
<Li> <a href = "#" title = "Discus"> </a> </li>
<Li> <a href = "#" title = "A Hear"> </a> </li>
<Li> <a href = "#" title = "edevil M"> </a> </li>
<Li> <a href = "#" title = "Scribb"> </a> </li>
<Li> <a href = "#" title = "Amanda"> </a> </li>
<Li> <a href = "#" title = "The Do"> </a> </li>
<Li> <a href = "#" title = "I See"> </A> </li>
<Li> <a href = "#" title = "Rock H"> </a> </li>
<Li> <a href = "#" title = "Bocce"> </a> </li>
<Li> <a href = "#" title = "Boris"> </a> </li>
<Li> <a href = "#" title = "Sneake"> </a> </li>
</Ul>
<Div style = "text-align: center; margin: 50px 0; font: normal 14px/24px 'Microsoft yahei'; clear: both; color: red">
<P> applicable browsers: 360, FireFox, Chrome, Safari, Opera, aoyou, sogou, and windows of the world. IE8 and below are not supported. </P>
</Div>
</Body>
</Html>
The CSS file source code is as follows: style.css
/* RESET */
Body {font-family: Tahoma, Helvetica, "\ 5b8b \ 4f53", "Arial", sans-serif; font-size: 12px; color: # fff ;}
Body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {margin: 0; padding: 0}
Input, button, textarea {border: none 0}
Fieldset, img {border: 0}
Table {border-collapse: collapse; border-spacing: 0}
Ul, ol {list-style: none}
A: link {text-decoration: none}
A: visited {text-decoration: none}
A: hover {text-decoration: none}
. Clear {zoom: 1}
. Clear: after {content: ""; display: block; clear: both}
/* Polaroids */
. Polaroids {width: 970px; margin: 0 0 18px 10px ;}
. Polaroids li {display: inline ;}
. Polaroids a {background: # fff; display: inline; float: left; margin: 0 0 27px 30px; width: auto; padding: 10px 10px 15px; text-align: center; font-family: "Marker Felt", sans-serif; text-decoration: none; color: #333; font-size: 18px;
-Webkit-box-shadow: 0 3px 6px rgba (0, 0,. 25 );
-Moz-box-shadow: 0 3px 6px rgba (0, 0,. 25 );
-O-box-shadow: 0 3px 6px rgba (0, 0,. 25 );
Box-shadow: 0 3px 6px rgba (0, 0, 0,. 25 );
}
. Polaroids img {display: block; width: pixel PX; margin-bottom: 12px ;}
. Polaroids a: after {content: attr (title);/* Ie8 +, FF, Chorme, Safari */}
. Polaroids li: nth-child (even) {
-Webkit-transform: rotate (2deg );
-Moz-transform: rotate (2deg );
-Ms-transform: rotate (2deg );
Transform: rotate (2deg );
}
. Polaroids li: nth-child (3n) {
-Webkit-transform: none;
-Moz-transform: none;
-Ms-transform: rotate (2deg );
Transform: none;
Position: relative;
Top:-5px;
}
. Polaroids li: nth-child (5n) {
-Webkit-transform: rotate (5deg );
-Moz-transform: rotate (5deg );
-Ms-transform: rotate (5deg );
Transform: rotate (5deg );
Position: relative;
Right: 5px;
}
. Polaroids li: nth-child (8n) {
Position: relative;
Top: 8px;
Right: 5px;
}
. Polaroids li: nth-child (11n) {
Position: relative;
Top: 3px;
Right:-5px;
}
. Polaroids li a: hover {
-Webkit-transform: scale (1.25 );
-Moz-transform: Scaling (1.25 );
-Ms-transform: scale (1, 1.25 );
Transform: scale (1, 1.25 );
-Webkit-box-shadow: 0 3px 6px rgba (0, 0,. 5 );
-Moz-box-shadow: 0 3px 6px rgba (0, 0,. 5 );
-O-box-shadow: 0 3px 6px rgba (0, 0,. 5 );
Box-shadow: 0 3px 6px rgba (0, 0, 0,. 5 );
Position: relative;
Z-index: 5;
}
. Polaroids li. messy a {margin-top:-375px; margin-left: 160px;
-Webkit-transform: rotate (-5deg );
-Moz-transform: rotate (-5deg );
-Ms-transform: rotate (-5deg );
Transform: rotate (-5deg );
}
Normal tests in chrome and ie