标题 发布时间 标题 发布时间
信息标题信息标题信息标题信息标题 2008-7-5 信息标题信息标题信息标题信息标题 2008-7-5
信息标题信息标题信息标题信息标题 2008-7-5 信息标题信息标题信息标题信息标题 2008-7-5
信息标题信息标题信息标题信息标题信息标题 2008-7-5 信息标题信息标题信息标题信息标题信息标题 2008-7-5
信息标题信息标题信息标题信息标题信息标题 2008-7-4 信息标题信息标题信息标题信息标题信息标题 2008-7-4
信息标题信息标题信息标题信息标题信息标题 2008-7-4 信息标题信息标题信息标题信息标题信息标题 2008-7-4 实现功能如上:新闻两栏如何用asp.net c#实现请教高手 都是来自同一个表,用datalist GridView还是其它方法?高手来呀
信息标题信息标题信息标题信息标题 2008-7-5 信息标题信息标题信息标题信息标题 2008-7-5
信息标题信息标题信息标题信息标题 2008-7-5 信息标题信息标题信息标题信息标题 2008-7-5
信息标题信息标题信息标题信息标题信息标题 2008-7-5 信息标题信息标题信息标题信息标题信息标题 2008-7-5
信息标题信息标题信息标题信息标题信息标题 2008-7-4 信息标题信息标题信息标题信息标题信息标题 2008-7-4
信息标题信息标题信息标题信息标题信息标题 2008-7-4 信息标题信息标题信息标题信息标题信息标题 2008-7-4 实现功能如上:新闻两栏如何用asp.net c#实现请教高手 都是来自同一个表,用datalist GridView还是其它方法?高手来呀
楼上的帮你解决了。。
<li class="title">信息标题信息标题信息标题信息标题信息标题</li>
<li class="date">2008-7-4</li>
.....
</ul>style样式设置方法如下:ul的宽度设置为title+date宽度的两倍多一点,
title的宽度和date的宽度,根据你需要进行设置
如果要对越长的内容,自动启用 "..."的,也可以设置在style中.效果可以打开:www.chnair.net,里面点开随便一条新闻,新闻正文下面的"相关链接"
http://www.chnair.net/news/show.aspx?id=21161style具体写法可参照
.link-list{clear:both; display:inherit; line-height:25px;}
.link-list .caption{width:680px; height:25px; color:Black;margin:10px 10px 10px 10px; background:#EBEBEB; text-align:left; font-weight:bold; font-size:14px; text-indent:1pc}
.link-list li{clear: none; float: left; width: 270px; background: url(skin/s_d2.gif) no-repeat 0 -14px ;display:inline-block ;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;-o-text-overflow: ellipsis;text-indent:5px; margin-left:20px}
.link-list .date {width:50px; float:left; display:block; background:none; margin:0px; text-indent:0px}
aspx中程序如下:
<div class="link-list">
<ul>
<li class="caption">相关链接</li>
<asp:Repeater ID="rptLink" runat="server">
<ItemTemplate><li><a href="<%# Eval("href")%>" title="<%#Eval("title")%>" target="_blank"><%#Eval("title")%></a></li><li class="date">[<%#Eval("createDate", "{0:MM/dd}")%>]</li>
</ItemTemplate></asp:Repeater> </ul>
<div class="blank3" style="margin:1px:auto"></div>
<p class="row10" style=" margin:10px auto; width:690px"></p>
</div>
RepeatDirection="horizontal" 设置横向显示记录
RepeatColumns="2" 设置每行显示上记录
具体代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DuBug.aspx.cs" Inherits="DuBug" %><!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>
<title>官网欢迎您!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="cssANDjs/mystyle.css" rel="stylesheet" type="text/css">
</head><body topmargin="0" leftmargin="0" bgcolor="#ffffff">
<form id="form1" runat="server">
<table width="726" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/websiteimage/righttable5title.gif" width="164" height="26" align="absbottom" /></td>
</tr>
<tr>
<td height="42" align="center" valign="bottom" background="images/websiteimage/bugbg1.jpg"><table width="670" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="358" height="35" valign="bottom"> <img src="images/websiteimage/bugitem1.gif" width="80" height="26" align="absbottom" /> <a href="DuBug2.aspx"><img src="images/websiteimage/bugitem2b.gif" width="80" height="26" border="0" align="absbottom" /></a> <a href="DuBug3.aspx"><img src="images/websiteimage/bugitem3b.gif" width="70" height="26" border="0" align="absbottom" /></a> <a href="DuBug4.aspx"><img src="images/websiteimage/bugitem4b.gif" width="70" height="26" border="0" align="absbottom" /></a></td>
<td width="312">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
ShowSummary="False" ValidationGroup="1a" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1" Display="None" ErrorMessage="搜索内容:请输入1-20个字符" ValidationExpression="^(.){1,22}$"
ValidationGroup="1a"></asp:RegularExpressionValidator>
<asp:TextBox ID="TextBox1" runat="server" Width="150px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
Display="None" ErrorMessage="搜索关键字不能为空" ValidationGroup="1a"></asp:RequiredFieldValidator>1<asp:ImageButton
ID="ImageButton1" runat="server" ImageUrl="images/websiteimage/bugbtn1.gif" OnClick="ImageButton1_Click"
ValidationGroup="1a" />
<asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False"
ImageUrl="images/websiteimage/bugbtn2.gif" OnClick="ImageButton2_Click" PostBackUrl="~/Bgsubmit.aspx" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="126" align="right" valign="top" background="images/websiteimage/bugbg2.jpg" style="text-align: center" >
<table border="0" cellpadding="0" cellspacing="0" width="680">
<tr align="left">
<td class="darkred" colspan="4" rowspan="6" valign="top">
<asp:DataList BorderWidth="0px" DataKeyField="BUGQusetionID" ID="DataList1" OnItemDataBound="DataList1_ItemDataBound" RepeatColumns="2" RepeatDirection="Horizontal" runat="server" ShowFooter="False">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" id="content" width="340">
<tr align="left">
<td class="darkred" colspan="2" rowspan="6" style="text-align: left">
·
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("BUGQusetionID","BgAnswtion.aspx?ID={0}") %>'
Target="_blank" Text='<%# Eval("BUGQuestion") %>'></asp:HyperLink></td>
<td class="darkred" colspan="2" rowspan="6" style="text-align: right">
<asp:Label ID="Label2" runat="server"></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<HeaderTemplate>
<table id="Table1" border="0" cellpadding="3" cellspacing="0" width="680">
<tr align="left">
<td class="darkred" colspan="2" rowspan="6" style="text-align: left">
标题</td>
<td class="darkred" colspan="2" rowspan="6" style="text-align: right">
状态
</td>
<td class="darkred" colspan="2" rowspan="6" style="text-align: left">
标题</td>
<td class="darkred" colspan="2" rowspan="6" style="text-align: right">
状态 </td>
</tr>
</table>
</HeaderTemplate>
</asp:DataList></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="35" align="right" background="images/websiteimage/bugbg3.jpg"><font color="#FF0000"><a href="BgQuAriticle.aspx" target="_blank">更多问题 >></a></font> </td>
</tr>
</table>
</form>
</body>
</html>
按照你的爱好来!!!