通过CSS控制图片样式,实现图片弹出效果
Code
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 2<html xmlns="http://www.w3.org/1999/xhtml" >
3 3<head>
4 4 <title>Untitled Page</title>
5 5 <style type = "text/css">
6 6 body{}{}{}{
7 7 margin-top:10px;
8 8 margin-right:0;
9 9 margin-bottom:0;
1010 margin-left:0;
1111 padding:0;
1212 }
1313 #picture{}{}{}{
1414 background-color:#ffffff;
1515 left:10px;
1616 position:relative;
1717 top:10px;
1818 width:35px;
1919 }
2020 #picture a .large{}{}{}{
2121 width:1px;
2222 display:block;
2323 left:-1px;
2424 top:-1px;
2525 height:1px;
2626 position:absolute;
2727 border-width:0px;
2828
2929 }
3030 #picture a img{}{}{}{
3131 border:0px;
3232 }
3333 #picture a.pop,#picture a.pop:visited{}{}{}{
3434 background:#ffffff;
3535 border:1px solid #000000;
3636 display:block;
3737 height:35px;
3838 left:0;
3939 text-decoration:none;
4040 top:0;
4141 width:35px;
4242 }
4343 #picture a.pop:hover{}{}{}{
4444 background:#8c97a3;
4545 color:#000000;
4646 text-decoration:none;
4747 }
4848 #picture a.pop:hover .large{}{}{}{
4949 border:1px solid #000000;
5050 display:block;
5151 height:200px;
5252 left:40px;
5353 position:absolute;
5454 top:40px;
5555 width:200px;
5656 }
5757 </style>
5858</head>
5959<body>
6060
6161<div id = "picture">
6262 <a class = "pop" href = "#">
6363 <img src = "midle.jpg" width = "35px" height = "35px" />
6464 <img src = "all1.jpg" width = "100px" height = "100px" class = "large" />
6565 </a>
6666</div>
6767
6868</body>
6969</html>
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 2<html xmlns="http://www.w3.org/1999/xhtml" >
3 3<head>
4 4 <title>Untitled Page</title>
5 5 <style type = "text/css">
6 6 body{}{}{}{
7 7 margin-top:10px;
8 8 margin-right:0;
9 9 margin-bottom:0;
1010 margin-left:0;
1111 padding:0;
1212 }
1313 #picture{}{}{}{
1414 background-color:#ffffff;
1515 left:10px;
1616 position:relative;
1717 top:10px;
1818 width:35px;
1919 }
2020 #picture a .large{}{}{}{
2121 width:1px;
2222 display:block;
2323 left:-1px;
2424 top:-1px;
2525 height:1px;
2626 position:absolute;
2727 border-width:0px;
2828
2929 }
3030 #picture a img{}{}{}{
3131 border:0px;
3232 }
3333 #picture a.pop,#picture a.pop:visited{}{}{}{
3434 background:#ffffff;
3535 border:1px solid #000000;
3636 display:block;
3737 height:35px;
3838 left:0;
3939 text-decoration:none;
4040 top:0;
4141 width:35px;
4242 }
4343 #picture a.pop:hover{}{}{}{
4444 background:#8c97a3;
4545 color:#000000;
4646 text-decoration:none;
4747 }
4848 #picture a.pop:hover .large{}{}{}{
4949 border:1px solid #000000;
5050 display:block;
5151 height:200px;
5252 left:40px;
5353 position:absolute;
5454 top:40px;
5555 width:200px;
5656 }
5757 </style>
5858</head>
5959<body>
6060
6161<div id = "picture">
6262 <a class = "pop" href = "#">
6363 <img src = "midle.jpg" width = "35px" height = "35px" />
6464 <img src = "all1.jpg" width = "100px" height = "100px" class = "large" />
6565 </a>
6666</div>
6767
6868</body>
6969</html>