ASP 横排显示图片问题
<divclass="wu"><divclass="zi"><strong>产品展示</strong></div></div><%dimnumssql="Select*f...
<div class="wu">
<div class="zi"><strong>产品展示</strong></div>
</div>
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize = 9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
do while not rs.eof and nums < rs.pagesize
%>
<div style="margin:0px;"><div class="rightkuang">
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a></div>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a>
</div>
</div>
<div class="s2"></div>
<%
nums = nums + 1
rs.movenext
loop
end if
%>
<%
rs.Close : set rs = nothing
%>
</div>
</div>
</div>
这是代码
就是现在图片显示是竖着的 我要横着的 展开
<div class="zi"><strong>产品展示</strong></div>
</div>
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize = 9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
do while not rs.eof and nums < rs.pagesize
%>
<div style="margin:0px;"><div class="rightkuang">
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a></div>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a>
</div>
</div>
<div class="s2"></div>
<%
nums = nums + 1
rs.movenext
loop
end if
%>
<%
rs.Close : set rs = nothing
%>
</div>
</div>
</div>
这是代码
就是现在图片显示是竖着的 我要横着的 展开
5个回答
展开全部
<style type="text/css">
<!--
li{
margin-top: 0px;
float: left;
display: block;
margin-bottom: 6px;
margin-left: 7px;
}
-->
</style>
<div class="wu">
<div class="zi"><strong>产品展示</strong></div>
</div>
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize =9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
do while not rs.eof and nums < rs.pagesize
%>
<UL>
<LI>
<div style="margin:0px;"><div class="rightkuang">
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a></div>
</div>
</div>
<div class="s2"></div>
</div>
</div>
</LI>
</UL>
<span class="zi">
<%
nums = nums + 1
rs.movenext
loop
end if
rs.Close
set rs = nothing
%>
</span>
我给你加了一组'<UL><LI>"要显示的图片"</LI></UL>'标签,然后再增加了li的css样式表定义,经我自己测试是可以横向显示图片的,而且会跟着窗口大小自动换行,希望能帮到你!
<!--
li{
margin-top: 0px;
float: left;
display: block;
margin-bottom: 6px;
margin-left: 7px;
}
-->
</style>
<div class="wu">
<div class="zi"><strong>产品展示</strong></div>
</div>
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize =9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
do while not rs.eof and nums < rs.pagesize
%>
<UL>
<LI>
<div style="margin:0px;"><div class="rightkuang">
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a></div>
</div>
</div>
<div class="s2"></div>
</div>
</div>
</LI>
</UL>
<span class="zi">
<%
nums = nums + 1
rs.movenext
loop
end if
rs.Close
set rs = nothing
%>
</span>
我给你加了一组'<UL><LI>"要显示的图片"</LI></UL>'标签,然后再增加了li的css样式表定义,经我自己测试是可以横向显示图片的,而且会跟着窗口大小自动换行,希望能帮到你!
展开全部
啥问题?说明白点。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
do while not rs.eof and nums < rs.pagesize
%>
<div style="margin:0px;float:left;"><div class="rightkuang">
<div class="kuang1">
你看清楚了吗.
再调整一下div的大小就可以了.
%>
<div style="margin:0px;float:left;"><div class="rightkuang">
<div class="kuang1">
你看清楚了吗.
再调整一下div的大小就可以了.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<div class="wu">
<div class="zi"><strong>产品展示</strong></div>
</div>
<div style="width:220px;">
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize = 9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
do while not rs.eof and nums < rs.pagesize
%>
<div style="margin:0px; width:100px; float:left;"><div class="rightkuang">
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a></div>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a>
</div>
</div>
<div class="s2"></div>
</div>
</div>
<%
nums = nums + 1
rs.movenext
loop
end if
%>
<%
rs.Close : set rs = nothing
%>
</div>
<div class="zi"><strong>产品展示</strong></div>
</div>
<div style="width:220px;">
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize = 9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
do while not rs.eof and nums < rs.pagesize
%>
<div style="margin:0px; width:100px; float:left;"><div class="rightkuang">
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a></div>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a>
</div>
</div>
<div class="s2"></div>
</div>
</div>
<%
nums = nums + 1
rs.movenext
loop
end if
%>
<%
rs.Close : set rs = nothing
%>
</div>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<div class="wu">
<div class="zi"><strong>产品展示</strong></div>
</div>
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize = 9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
%>
<div style="margin:0px;"><div class="rightkuang">
<%do while not rs.eof and nums < rs.pagesize%>
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a></div>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a>
</div><%
nums = nums + 1
rs.movenext
loop
%>
</div>
<div class="s2"></div>
<%end if
rs.Close : set rs = nothing
%>
</div>
</div>
</div>
<div class="zi"><strong>产品展示</strong></div>
</div>
<%
dim nums
sql = "Select * from "&TableArticle&" where ClassID=2 order by id desc"
Set rs = server.CreateObject("AdoDb.RecordSet")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("没有信息")
else
rs.pagesize = 9
Page = CLng(Request("Page"))
If clng(Page) < 1 Then Page = 1
If clng(Page) > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = clng(Page)
nums=0
%>
<div style="margin:0px;"><div class="rightkuang">
<%do while not rs.eof and nums < rs.pagesize%>
<div class="kuang1">
<div class="tu"><a href="showzy.asp?ID=<%=Rs("ID")%>"><img src="<%=Rs("Previewimg")%>" border="0" width="145" height="84"></a></div>
<div class="zi">
<span class="h">产品展示:</span><BR/>
<a href="showzy.asp?ID=<%=Rs("ID")%>"><%=Rs("Title")%></a>
</div><%
nums = nums + 1
rs.movenext
loop
%>
</div>
<div class="s2"></div>
<%end if
rs.Close : set rs = nothing
%>
</div>
</div>
</div>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询