css span右对齐 css li标签中span日期靠右布局实现代码

  发布时间:2012-12-18 11:40:59   作者:佚名   我要评论
在网页布局中经常会碰到新闻标题靠左日期靠右,想要实现这种布局效果,需要在代码上下点功夫,本人比较上心,也遇到此问题,于是搜集整理一下,需要的朋友可以参考下

复制代码
代码如下:

<!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" />
<title>css教程 li span日期靠右排列实例</title>
<style>
.artlist{height:100%; overflow:hidden; margin:10px;}
.artlist ul{ margin:0px;}
.artlist ul li{ list-style:none;line-height:28px;}
.artlist ul li span{ float:right;padding-right:10px;}
.artlist ul li a{ color:#333;}
</style>
</head>
<body>
<table width="98%" border="0" class="artbody">
<tr>
<td >
<div class="artlist">
<ul>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
<li><span>2011-03-22</span><a href="a">fdafjdsaklfjdaklfdjalkf;djakfl;dsajfk</a></li>
</ul>
</div>
</td>
</tr>
</table>
</body>
</html>

相关文章

最新评论