asp.net 新闻列表样式代码
更新时间:2011年02月19日 18:07:02 作者:
asp.net下新闻列表样式显示代码,使用Repeater控件。
新闻列表:
<div class="news_list">
<asp:Repeater ID="gsxw" runat="server" DataSourceID="GetNewsByType">
<ItemTemplate>
<ul> <li><span>
<%# Convert.ToDateTime(Eval("NTime")).ToShortDateString()%></span><a
href='newdetails.aspx?Type=<%=num %>&&id=<%# Eval("ID") %>&&Page=0'>·<%# Eval("NTitle") %></a></li>
</ul></ItemTemplate>
</asp:Repeater>
</div>
css文件:
.news_list { width:752px; padding:10px 10px;clear:both; padding:0px; line-height:170%;}
.news_list a:hover{ color:#2C4900; font-weight:700;}
.news_list p { float:left; border:1px solid #e4e4e4; padding:4px; margin-right:10px;}
.news_list dl { color:#008804; line-height:25px; font-weight:700;}
.news_list dd { color:#666666; line-height:22px; text-indent:24px;}
.news_list li { color:#0F5300; line-height:28px; text-indent:5px; border-bottom:1px dashed #CFCFCF;}
.news_list a { color:#0F5300;}
.news_list span { color:#A3DC01; float:right;}
复制代码 代码如下:
<div class="news_list">
<asp:Repeater ID="gsxw" runat="server" DataSourceID="GetNewsByType">
<ItemTemplate>
<ul> <li><span>
<%# Convert.ToDateTime(Eval("NTime")).ToShortDateString()%></span><a
href='newdetails.aspx?Type=<%=num %>&&id=<%# Eval("ID") %>&&Page=0'>·<%# Eval("NTitle") %></a></li>
</ul></ItemTemplate>
</asp:Repeater>
</div>
css文件:
复制代码 代码如下:
.news_list { width:752px; padding:10px 10px;clear:both; padding:0px; line-height:170%;}
.news_list a:hover{ color:#2C4900; font-weight:700;}
.news_list p { float:left; border:1px solid #e4e4e4; padding:4px; margin-right:10px;}
.news_list dl { color:#008804; line-height:25px; font-weight:700;}
.news_list dd { color:#666666; line-height:22px; text-indent:24px;}
.news_list li { color:#0F5300; line-height:28px; text-indent:5px; border-bottom:1px dashed #CFCFCF;}
.news_list a { color:#0F5300;}
.news_list span { color:#A3DC01; float:right;}
相关文章
详解Asp.net 5中的ApplicationBuilder
这篇文章介绍了Asp.net 5中的ApplicationBuilder,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2022-01-01
.Net中的不可变集合(Immutable Collection)程序集简介
这篇文章介绍了.Net中的不可变集合(Immutable Collection)程序集,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2022-06-06
.NET Core使用CZGL.SystemInfo库获取主机运行资源
这篇文章介绍了.NET Core使用CZGL.SystemInfo库获取主机运行资源的方法,文中通过示例代码介绍的非常详细。对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2022-01-01
发布WEB站点时出现Server Application Unavailable
发布WEB站点时出现Server Application Unavailable...2006-12-12


最新评论