from :  http://www.onlyaa.com/html/htmlcss/20080522/2144.html

原文地址:http://weilaixu.cn/view.php?id=137
要点:a的浮动.
需要注意的:li的清除浮动

看图:
css多行多列的新闻模式
这种效果,甚至是三列四列的新闻模块,以前我都用table,以为比css方便,直到后来发先了a的浮动之后,原来用ul更方面,更容易控制,先来看看代码吧:

引用:
.news{}
.news li{ list-style:none; clear:both}
.news li a#n1{ text-decoration:none; float:left; line-height:22px;}
.news li a#n2{ text-decoration:none; float:right; color:#999}
.news li a#n3{ float:right; padding-right:20px;color:#999}
.news li a#n1:hover{ text-decoration:underline;}
.news li a#n3:hover,.news li a#n3:hover{ text-decoration:none;}

a#n1为新闻标题,左浮动,n2和n3为点击次数和发布日期,右浮动,距离20px;
注意,li上一定要清除所有浮动.
测试支持ie6,ie7,ff,opera.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2021-04-10
  • 2021-09-21
相关资源
相似解决方案