作家
登录

CSS 网页布局中的图文列表实现代码

作者: 来源:www.28hudong.com 2012-11-19 22:21:43 阅读 我要评论

搜狐新闻中心,左边栏图文列表:          图文html结构:  程序代码 <div class="picTextGroup">     <p>           <a href="" alt""><img src="图片"/></a>           <span class="title"><a href="" alt"">大标题</a></span></br>           文字介绍内容....                       <span class=moreT>[<a href="" target=_blank>详细</a>]</span>     </p></div> 看具体演示效果: <!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" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <title>新闻中心-搜狐</title> <style type="text/css"> /* 全局CSS定义 */ body { text-align: center; margin:0 auto; padding:0; background: #FFF; font-size:12px; color:#000;font-family:宋体;} body > div {text-align:center; margin-right:auto; margin-left:auto;} div,form,ul,ol,li,span,p {margin: 0; padding: 0; border: 0;} img,a img{border:0; margin:0; padding:0;} h1,h2,h3,h4,h5,h6 { margin:0; padding:0;font-size:12px;font-weight:normal;} ul,ol,li {list-style:none} table,td,input {font-size:12px} table {margin:0 auto;} .column380 {width:380px;float:left;display:inline;border:1px solid #B8CBE4;margin:50px;} .blank10 {margin:0 auto;height:10px; font-size:1px;clear:both;} h2 {height:20px;background: #D8E3F1 url(http://news.sohu.com/upload/2008_sohunews/images/bg08.gif) no-repeat left top;color:#039;text-align:right;padding:0 4px 0 14px;line-height:20px;border-bottom:1px solid #B8CBE4;} h2 span {font-weight: bold;float:left;} h2 a {color:#039;} .picTextGroup {width:352px;margin:0 auto;color:#666;line-height:20px;} .picTextGroup img {margin:0 10px 0 0;border:1px #A5C0E1 solid;background:#fff;padding:1px;} .picTextGroup .title {color:#039;font-size:18px;font-weight: bold;line-height:26px;} .picTextGroup .title a {color:#039;} .picTextGroup a {color:#666;} .picTextGroup .moreT a {color:#A4621C;} .picTextGroup a:hover {color:#CC0000;} .f12list ul {width:360px;margin:0 auto;clear:both;} /* 链接颜色 */ a {color: #000;text-decoration:none} a:hover {text-decoration:underline;} .picTextGroup {text-align:left;margin:0 auto;line-height:20px;color:#333;width:92%} .picTextGroup img {margin:0 4px 0 0;float:left;} /*图文混排*/ .picTextGroup a {color:#333;} .picTextGroup p {clear:none} /* 列表属性 */ .f12list .more {text-align:right} .f12list li,.f12list p {color:#333;line-height:22px;font-size:12px;text-align:left} .f12list li a,.f12list p a {color:#333} .f12blue td a,.f12list tr a {color:#003399} </style> </head> <body> <div class="column380"> <h2><span><a href="" target=_blank>深度关注</a></span><a href="" target=_blank>更多>></a></h2> <div class=blank10></div> <div class=picTextGroup> <p><a href="" target=_blank> <img height=70 alt=当代中国大学生信仰调查 src="http://i0.itc.cn/20091014/777_10b40fce_706f_42e9_bf7e_1cb0a994ca80_0.jpg" width=70 border=0> </a> <span class=title><a href="" target=_blank>当代中国大学生信仰调查</a></span><br>如今,年轻一代在荧幕中高喊:因为信仰,向死而生。战争年代不再,信仰是否依旧…<span class=moreT>[<a href="" target=_blank>详细</a>]</span> </p> </div> <div class=blank6></div> <div class=f12list> <ul> <li>·<a href="" target=_blank>公民刘春梅之死</a>·<a class="" href="" target=_blank>高校腐败几时休,民众几时休,之恨何时已</a></li> <li>·<a class="" href="" target=_blank>伊朗核谈判再现新较量</a>·<a class="" href="" target=_blank>气候变暖下,小国的苦苦抗争</a></li> <li>·<a href="" target=_blank>课堂教学在PPT中渐失灵魂</a>·<a class="" href="" target=_blank>假如我中了3.6亿巨奖</a></li> </li> </ul> </div> <div class="blank10"></div> </div> </body> </html> 提示:您可以先修改部分代码再运行

  推荐阅读

  DIV CSS网页设计 有用的3个CSS技巧

一、在一行内声明CSS  复制代码代码如下:h2 {font-size:18px; border:1px solid blue; color:#000; background-color:#FFF;} h2 {font-size:18px; border:1px solid blue; color:#000; background-color:#FF>>>详细阅读


本文标题:CSS 网页布局中的图文列表实现代码

地址:http://www.17bianji.com/kaifa2/CSS/16524.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)