标签:css选择器 htm des padding esc .gz oat meta 文件
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>img</title> <link rel="stylesheet" type="text/css" href="../static/css/wu.css"> </head> <body> <div class="recommend"> <div class="img"> <a hrefclas="http://www.gzcc.cn"><img src="http://static.runoob.com/images/demo/demo4.jpg" alt=""></a> <div class="desc"><a href="http://www.gzcc.cn">校园风光</a></div> </div> <div class="img"> <a href="http://www.gzcc.cn"><img src="http://static.runoob.com/images/demo/demo3.jpg" alt=""></a> <div class="desc"><a href="http://www.gzcc.cn">校友风采</a></div> </div> <div class="img"> <a href="http://www.gzcc.cn"><img src="http://static.runoob.com/images/demo/demo2.jpg" alt=""></a> <div class="desc"><a href="http://www.gzcc.cn">学样文化</a></div> </div> <div class="img"> <a href="http://www.gzcc.cn"><img src="http://static.runoob.com/images/demo/demo1.jpg" alt=""></a> <div class="desc"><a href="http://www.gzcc.cn">学生风采</a></div> </div> </div> <br> <div class="clearfolat"> <img src="http://static.runoob.com/images/demo/demo4.jpg"> <img src="http://static.runoob.com/images/demo/demo3.jpg"> <img src="http://static.runoob.com/images/demo/demo2.jpg"> <img src="http://static.runoob.com/images/demo/demo1.jpg"> </div> </body> </html>
css
img { width: 300px; } div.img{ border:1px solid #cccccc; float: left; margin: 5px; width:180px; } div.img img{ width:100%; height:auto; } div.desc{ text-align: center; padding: 5px; } div.img:hover{ border:1px solid #000000; } div.clearfolat{ clear: both; }
标签:css选择器 htm des padding esc .gz oat meta 文件
原文地址:http://www.cnblogs.com/0020l/p/7698847.html