<!doctype html public ‘-//w3c//dtd html 4.01//en’ ‘http://www.w3.org/tr/html4/strict.dtd’> <html> <head> <title>CSS List Grid View Layout</title> <style> body{ font-family:Arial; text-align:center; } p{ } .img-grid{ width:603px; margin:auto; overflow:hidden; position:relative; border:solid 20px #CCCCCC; } .img-grid h3{ padding:0 0 12px 0; background:#ccc; margin:0; font:normal normal bold 3em/normal “Georgia”; letter-spacing:-0.1em; text-align:center; } .img-grid ul{ list-style-type:none; margin:-1px 0 0 -1px; padding:0; width:100%; border-width:0px 1px 0 0; position:relative; } .img-grid li{ zoom:1; list-style-type:none; margin:0; padding:0; vertical-align:middle; width:200px; padding:0 0 30px 0; text-align:center; position:relative; border:solid 1px #dedede; border-top-color:#CCCCCC; margin:-1px -1px 0 0; border-width:1px 0 0px 1px; float:left; display:inline; font:150px/normal “Times new roman”; *padding:0; *font-size:180px; } .img-grid li img { vertical-align:middle; background:#fff; font-size:12px; padding:2px; border:solid 1px #555; } .img-grid li a:hover{ text-indent:0;/*IE6 need this to trigger :hover*/ } .img-grid li a:hover img{ padding:1px; border:solid 2px #336699; } .img-grid li strong{ display:block; font:small/1.1 Arial; background:#fff; position:absolute; bottom:0; left:0; width:100%; } .img-grid li strong a{ display:block; padding:8px 4px; color:#336699; text-decoration:none; zoom:1; } .img-grid li strong a:hover{ text-decoration:underline; } </style> </head> <body> <h1>CSS List Grid Layout</h1> <p>Compatible and tested with IE6, IE7, Safari 2, Safari 3, Firefox 2, Opera 9.21</p> <div class=”img-grid”> <h3>List Grid View</h3> <ul> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”20″ alt=”image” /></a> <strong><a href=”#”>sodales porta libero.n</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”40″ alt=”image” /></a> <strong><a href=”#”>sodales porterat. Nunc eu risus ut dolor bibendum adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”60″ alt=”image” /></a> <strong><a href=”#”>sodales porta libero. Integerdum adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”80″ alt=”image” /></a> <strong><a href=”#”>sodales porta libero. Integer adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”100″ alt=”image” /></a> <strong><a href=”#”>sodalesber Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”110″ alt=”image” /></a> <strong><a href=”#”>sodales in</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”20″ alt=”image” /></a> <strong><a href=”#”>sodales porta libero. Integer dignissim sceiquam erat. Nunc eu risus ut dolor bibendum adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”40″ alt=”image” /></a> <strong><a href=”#”>sodales porterat. Nunc eu risus ut dolor bibendum adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”60″ alt=”image” /></a> <strong><a href=”#”>sodales porta libero. Integer dignissim scelerisque massa.ndum adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”80″ alt=”image” /></a> <strong><a href=”#”>sodales porta libero. Integer dignissim at. Nunc eu risus ut dolor bibendum adipiscing. Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”100″ alt=”image” /></a> <strong><a href=”#”>sodales porta liber Proin</a></strong> </li> <li> <a href=”#”><img src=”http://farm1.static.flickr.com/182/424905397_d0ab1d8eea_m.jpg” height=”110″ alt=”image” /></a> <strong><a href=”#”>sodales porta liberor bibendum adipiscing. Proin</a></strong> </li> </ul> </div> </body> </html>
[Ctrl+A 全选 注:引入外部Js需再刷新一下页面才能执行]
免责声明:
1、本网站所有发布的源码、软件和资料均为收集各大资源网站整理而来;仅限用于学习和研究目的,您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。
不得使用于非法商业用途,不得违反国家法律。否则后果自负!
2、本站信息来自网络,版权争议与本站无关。一切关于该资源商业行为与www.niceym.com无关。
如果您喜欢该程序,请支持正版源码、软件,购买注册,得到更好的正版服务。
如有侵犯你版权的,请邮件与我们联系处理(邮箱:skknet@qq.com),本站将立即改正。
NICE源码网 CSS/HTML CSS List Grid Layout 图片垂直居中 https://www.niceym.com/16962.html
猜你喜欢
- CSS的使用技巧 2023-02-17
- CSS: 如何让img图片自适应父元素 2022-08-05
- DIV+CSS经常用到的属性、参数及说明 2022-04-15
- BS项目中的CSS架构_仅加载自己需要的CSS 2022-04-15
- 左侧固定宽度,右侧自适应宽度的CSS布局 2022-04-15
- 门户网站构建CSS框架的规则 2022-04-15
- 指定网页的doctype解决CSS Hacking方法总结 2022-04-15
- css网页布局中注意的几个问题小结 2022-04-15
- css import与link的区别 2022-04-15
- css图片切换效果代码[不用js] 2022-04-15