首页 新闻 会员 周边

关于Div+CSS 布局的简单问题

0
[已关闭问题] 关闭于 2011-12-14 12:58

我想实现这样的功能

生活资讯     more..
资讯1
资讯1
资讯1
资讯1
资讯1

可我做完之后发现,某些情况下,“资讯1”这样的标题会跑到“生活资讯”类别中去,下面是我的代码

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategorySummary.ascx.cs" Inherits="controls_CategorySummary"%>
<div id="container" style="border:solid 1px #666; margin-top:5px;">
<div id="top" style="width:100%; margin-top:3px;background-color:#EEE;">
<div id="top_left" style="width:70%;float:left">
<span id="categorySpan" runat="server">123</span>
</div>
<div id="top_right" style="float:right; width:30%;">
<a id="moreHref" runat="server">More..</a>
</div>
</div>
<div id="articleSummary" style="margin-top:5px; width:100%;">
<asp:Repeater ID="titleRepeater" runat="server">
<ItemTemplate>
<p style="margin:3px 0">
<a id="titleHref" style="font-size:10pt;white-space:nowrap; overflow:hidden;" runat="server" href='<%# "../Show.aspx?id=" + Eval("Id") %>'><%# Eval("Title") %></a>
</p>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
it9527的主页 it9527 | 初学一级 | 园豆:5
提问于:2011-12-07 10:53
< >
分享
所有回答(1)
1

<div id="articleSummary" style="margin-top:5px; width:100%;">
<asp:Repeater ID="titleRepeater" runat="server">
<ItemTemplate>
<p style="margin:3px 0">
<a id="titleHref" style="font-size:10pt;white-space:nowrap; overflow:hidden;" runat="server" href='<%# "../Show.aspx?id=" + Eval("Id") %>'><%# Eval("Title") %></a>
</p>
</ItemTemplate>
</asp:Repeater>
</div>
改为

<div id="articleSummary" style="margin-top:5px; width:100%;">
<ul style="list-style:none;padding:0px;margin:0px;">
<asp:Repeater ID="titleRepeater" runat="server">
<ItemTemplate>
<li>
<a id="titleHref" style="font-size:10pt;white-space:nowrap; overflow:hidden;" runat="server" href='<%# "../Show.aspx?id=" + Eval("Id") %>'><%# Eval("Title") %></a>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>

试试


artwl | 园豆:16736 (专家六级) | 2011-12-07 11:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册