基于锚点的相册
效果图:
CSS
* {
padding:0;
margin:0;
}
body {
margin:40px;
}
ul {
margin:0 auto;
width:480px;
height:360px;
background:#333;
list-style-type:none;
overflow:hidden; /*溢出隐藏*/
}
ul li {
width:480px;
height:360px;
}
ul li img {
padding:40px 0 0 40px;
}
p {
text-align:center;
padding-top:10px;
}
p img {
border:1px solid black;
}
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>基于锚点的相册</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <ul> <li><a name="p1"><img src="images/pics1.jpg" alt="pics1" /></a></li> <li><a name="p2"><img src="images/pics2.jpg" alt="pics2" /></a></li> <li><a name="p3"><img src="images/pics3.jpg" alt="pics3" /></a></li> </ul> <p> <a href="#p1"><img src="images/p1.jpg" alt="p1" /></a> <a href="#p2"><img src="images/p2.jpg" alt="p2" /></a> <a href="#p3"><img src="images/p3.jpg" alt="p3" /></a> </p> </body> </html>