实例首页
自学教程
IT工具箱
源代码
下载代码
上下布局
点击运行 >
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>css 图片廊 实例 - 自学教程(runoops.com)</title> <style> .responsive div.img { margin: 5px; border: 1px solid #ccc; float: left; width: 180px; } .responsive div.img:hover { border: 1px solid #777; } .responsive div.img img { width: 100%; height: auto; } .responsive div.desc { padding: 15px; text-align: center; } </style> </head> <body> <div class="responsive"> <div class="img"> <a target="_blank" href="//demo.runoops.com/static/img/a1.jpg"> <img src="//demo.runoops.com/static/img/a1.jpg" alt="图片文本描述" width="300" height="200"> </a> <div class="desc">这里添加图片文本描述</div> </div> </div> <div class="responsive"> <div class="img"> <a target="_blank" href="//demo.runoops.com/static/img/a2.jpg"> <img src="//demo.runoops.com/static/img/a2.jpg" alt="图片文本描述" width="300" height="200"> </a> <div class="desc">这里添加图片文本描述</div> </div> </div> <div class="responsive"> <div class="img"> <a target="_blank" href="//demo.runoops.com/static/img/a3.jpg"> <img src="//demo.runoops.com/static/img/a3.jpg" alt="图片文本描述" width="300" height="200"> </a> <div class="desc">这里添加图片文本描述</div> </div> </div> <div class="responsive"> <div class="img"> <a target="_blank" href="//demo.runoops.com/static/img/a4.jpg"> <img src="//demo.runoops.com/static/img/a4.jpg" alt="图片文本描述" width="300" height="200"> </a> <div class="desc">这里添加图片文本描述</div> </div> </div> </body> </html>
运行结果: