CSS List Grid Layout 圖片垂直置中_經驗交流

來源:互聯網
上載者:User
<!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> <h3>List Grid View</h3> <ul> <li> <strong>sodales porta libero.n</strong> </li> <li> <strong>sodales porterat. Nunc eu risus ut dolor bibendum adipiscing. Proin</strong> </li> <li> <strong>sodales porta libero. Integerdum adipiscing. Proin</strong> </li> <li> <strong>sodales porta libero. Integer adipiscing. Proin</strong> </li> <li> <strong>sodalesber Proin</strong> </li> <li> <strong>sodales in</strong> </li> <li> <strong>sodales porta libero. Integer dignissim sceiquam erat. Nunc eu risus ut dolor bibendum adipiscing. Proin</strong> </li> <li> <strong>sodales porterat. Nunc eu risus ut dolor bibendum adipiscing. Proin</strong> </li> <li> <strong>sodales porta libero. Integer dignissim scelerisque massa.ndum adipiscing. Proin</strong> </li> <li> <strong>sodales porta libero. Integer dignissim at. Nunc eu risus ut dolor bibendum adipiscing. Proin</strong> </li> <li> <strong>sodales porta liber Proin</strong> </li> <li> <strong>sodales porta liberor bibendum adipiscing. Proin</strong> </li> </ul> </body> </html>
[Ctrl+A 全選 注:如需引入外部Js需重新整理才能執行]
  • 相關文章

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.