1个大的DIV下如何让两个小的DIV横向排列
请看下面的代码如何让两个小的DIV横排显示而不是纵排显示<divclass="buy_banner"><divclass="buy"><h2><imgsrc="image...
请看下面的代码如何让两个小的DIV横排显示而不是纵排显示
<div class="buy_banner">
<div class="buy " >
<h2><img src="images/f_03.gif" class="p-r5" />看房日记<span><a href="/news/list.asp?/=17" target="_blank"></a></span></h2>
<div class="piclink">
<div>
<%
sql = "select top 1 htmlPath,redirectUrl,title,isRedirect,photoUrl from ["& Cfg.tablePrefix &"news]"
sql = sql & " where photoUrl <> '' and classId = 17 and isSign = 1"
sql = sql & " order by Id desc"
rs = dbo.query(sql)
if isnull(rs) or isempty(rs) then
response.Write("暂无数据")
else
for i = 0 to ubound(rs,2)
htmlPath = rs(0,i)
redirectUrl = rs(1,i)
title = rs(2,i)
isRedirect = rs(3,i)
photoUrl = rs(4,i)
if isRedirect and redirectUrl <> "" then
titleStr = redirectUrl
else
titleStr = "http://www.0391fc.com/" & htmlPath
end if
next
end if
set rs = nothing
%>
<a href="<% = titleStr %>" title="<% = title %>" target="_blank"><img src="<% = "http://www.0391fc.com/" & photoUrl %>" width="106" height="93" alt="<% = title %>" /></a> </div>
<ul>
<% = lib.GetNewsListDiv(17,5,26,false,false,false,0,"",0,0,1,1,1,"","") %>
<span class="news"> </span>
</ul>
</div>
</div>
<div class="buy">
<h2><img src="images/f_03.gif" class="p-r5" />团购活动<span><a href="/news/list.asp?/=12" target="_blank"></a></span></h2>
<div class="piclink">
<div>
<%
sql = "select top 1 htmlPath,redirectUrl,title,isRedirect,photoUrl from ["& Cfg.tablePrefix &"news]"
sql = sql & " where photoUrl <> '' and classId = 12 and isSign = 1"
sql = sql & " order by Id desc"
rs = dbo.query(sql)
if isnull(rs) or isempty(rs) then
response.Write("暂无数据")
else
for i = 0 to ubound(rs,2)
htmlPath = rs(0,i)
redirectUrl = rs(1,i)
title = rs(2,i)
isRedirect = rs(3,i)
photoUrl = rs(4,i)
if isRedirect and redirectUrl <> "" then
titleStr = redirectUrl
else
titleStr = "http://www.0391fc.com/" & htmlPath
end if
next
end if
set rs = nothing
%>
<a href="<% = titleStr %>" title="<% = title %>" target="_blank"><img src="<% = "http://www.0391fc.com/" & photoUrl %>" width="106" height="93" alt="<% = title %>" /></a> </div>
<ul>
<% = lib.GetNewsListDiv(12,5,26,false,false,false,0,"",0,0,1,1,1,"","") %>
</ul> </div>
</div>
</div> 展开
<div class="buy_banner">
<div class="buy " >
<h2><img src="images/f_03.gif" class="p-r5" />看房日记<span><a href="/news/list.asp?/=17" target="_blank"></a></span></h2>
<div class="piclink">
<div>
<%
sql = "select top 1 htmlPath,redirectUrl,title,isRedirect,photoUrl from ["& Cfg.tablePrefix &"news]"
sql = sql & " where photoUrl <> '' and classId = 17 and isSign = 1"
sql = sql & " order by Id desc"
rs = dbo.query(sql)
if isnull(rs) or isempty(rs) then
response.Write("暂无数据")
else
for i = 0 to ubound(rs,2)
htmlPath = rs(0,i)
redirectUrl = rs(1,i)
title = rs(2,i)
isRedirect = rs(3,i)
photoUrl = rs(4,i)
if isRedirect and redirectUrl <> "" then
titleStr = redirectUrl
else
titleStr = "http://www.0391fc.com/" & htmlPath
end if
next
end if
set rs = nothing
%>
<a href="<% = titleStr %>" title="<% = title %>" target="_blank"><img src="<% = "http://www.0391fc.com/" & photoUrl %>" width="106" height="93" alt="<% = title %>" /></a> </div>
<ul>
<% = lib.GetNewsListDiv(17,5,26,false,false,false,0,"",0,0,1,1,1,"","") %>
<span class="news"> </span>
</ul>
</div>
</div>
<div class="buy">
<h2><img src="images/f_03.gif" class="p-r5" />团购活动<span><a href="/news/list.asp?/=12" target="_blank"></a></span></h2>
<div class="piclink">
<div>
<%
sql = "select top 1 htmlPath,redirectUrl,title,isRedirect,photoUrl from ["& Cfg.tablePrefix &"news]"
sql = sql & " where photoUrl <> '' and classId = 12 and isSign = 1"
sql = sql & " order by Id desc"
rs = dbo.query(sql)
if isnull(rs) or isempty(rs) then
response.Write("暂无数据")
else
for i = 0 to ubound(rs,2)
htmlPath = rs(0,i)
redirectUrl = rs(1,i)
title = rs(2,i)
isRedirect = rs(3,i)
photoUrl = rs(4,i)
if isRedirect and redirectUrl <> "" then
titleStr = redirectUrl
else
titleStr = "http://www.0391fc.com/" & htmlPath
end if
next
end if
set rs = nothing
%>
<a href="<% = titleStr %>" title="<% = title %>" target="_blank"><img src="<% = "http://www.0391fc.com/" & photoUrl %>" width="106" height="93" alt="<% = title %>" /></a> </div>
<ul>
<% = lib.GetNewsListDiv(12,5,26,false,false,false,0,"",0,0,1,1,1,"","") %>
</ul> </div>
</div>
</div> 展开
4个回答
展开全部
buy里面
float:left;
宽度设成49% 或比49%小 !
float:left;
宽度设成49% 或比49%小 !
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
样式那写 float:left
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询