| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1001 人关注过本帖
标题:请问怎么设置一行4个图片?
只看楼主 加入收藏
znmw
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2011-3-6
收藏
 问题点数:0 回复次数:3 
请问怎么设置一行4个图片?
图片附件: 游客没有浏览图片的权限,请 登录注册

请问怎么设置一行4个图片?谢谢。
<!--#include file="Inc/conn.asp"-->
<!--#include file="Inc/Function_Page.asp"-->
<!--#include file="Top1.asp"-->
<%
Dim ID
ID=newRequest(request("id"))
If ID="" then
Call Alert("不正确的ID","Index.asp")
end if
set rsclass=server.createobject("adodb.recordset")
sql="select * from "&tbname&"_Class where id="&id
rsclass.open sql,conn,1,1
if rsclass.eof and rsclass.bof then
Call Alert("不正确的ID","Index.asp")
else
if rsclass("Link")=1 then
Response.Redirect ""&laoy(rsclass("Url"))&""
End if

%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="<%=rsclass("keyword")%>" />
<meta name="description" content="<%=rsclass("ReadMe")%>" />
<link href="<%=SitePath%>images/css<%=Css%>.css" ID="skin" type=text/css rel=stylesheet>
<link rel="shortcut icon" href="<%=SitePath%>images/myfav.ico" type="image/x-icon" />
<script type="text/javascript" src="<%=SitePath%>js/main.asp"></script><%If rss=1 then%>
<link rel="alternate" title="订阅<%=rsclass("ClassName")%>(RSS 2.0)" href="http://<%=SiteUrl%><%=SitePath%>Rss/Rss<%=ID%>.xml" type="application/rss+xml" /><%end if%>
<title><%=LoseHtml(rsclass("ClassName"))%><%=IIF(rsclass("ClassName2")<>"","-"&rsclass("ClassName2")&"-","-")%><%=SiteTitle%></title>
</head>
<body>
<div class="mwall">
<%=Head%>
<%=Menu%><div class="mw">
    <div class="dh">
        <%=search%>您现在的位置:<a href="Index.asp">首页</a> >>  <a href="<%=IIF(Html=3,"IndexNew.html","IndexNew.asp")%>">文章首页</a> >> <%If rsclass("TopID")>0 then%><a href="<%=IIF(Html=3,"Class_"&rsclass("TopID")&".html","Class.asp?ID="&rsclass("TopID")&"")%>"><%=Classlist(rsclass("TopID"))%></a> >> <%End if%><a href="<%=IIF(Html=3,"Class_"&ID&".html","Class.asp?ID="&ID&"")%>"><%=rsclass("ClassName")%></a> >> 列表
    </div>
    <div id="nw_left">
<%If Mydb("Select Count([ID]) From ["&tbname&"_Class] Where TopID="&ID&"",1)(0)>0 then%>
        <div id="web2l" style="border:0;"><%
            Sqlpp ="select [ID],[ClassName] from "&tbname&"_Class Where TopID="&ID&" order by num"   
               Set Rspp=server.CreateObject("adodb.recordset")   
               rspp.open sqlpp,conn,1,1
            NoI=0
            Do while not Rspp.Eof
            NoI=NoI+1
%>
            <div id="web2l" class="borderall"<%If isEven(NoI)=0 then Response.Write(" style=""margin-left:0px;""") End if%>>
                <h6><a href="<%=SitePath%><%=IIF(Html=3,"Class_"&rspp("ID")&".html","Class.asp?ID="&rspp("ID")&"")%>"><%=rspp("ClassName")%></a><span align="right">   <a href="<%=SitePath%><%=IIF(Html=3,"Class_"&rspp("ID")&".html","Class.asp?ID="&rspp("ID")&"")%>">more...</a></span></h6>
<ul class="topimg">
               
                    <%Call ShowImgArticle(rspp("id"),10,10,"no","DateAndTime desc,ID desc")%>

                </ul>
            </div><%If isEven(NoI)=0 then Response.Write("<div id=""clear""></div>") End if
            Rspp.Movenext   
              Loop
               rspp.close
               set rspp=nothing
%>
        </div>
<%else%>
        <div id="web2l">
            <h6><%=rsclass("ClassName")%><a href="<%=SitePath%><%=IIF(Html=3,"Class_"&rspp("ID")&".html","Class.asp?ID="&rspp("ID")&"")%>"><%=rspp("ClassName")%></a></h6>
            <div id="content">
                <ul id="listul">

<%
Set mypage=new xdownpage
mypage.getconn=conn
mypage.getsql="Select ID,Title,DateAndTime,Hits,IsTop,Images,TitleFontColor,Artdescription from "&tbname&"_Article Where ClassID="&rsclass("ID")&" and yn=0 order by IsTop desc,DateAndTime desc"
mypage.pagesize=artlistnum  这个是后台设置显示多少编文章为一页的
set rs=mypage.getrs()
for i=1 to mypage.pagesize
    if not rs.eof then
%>   我现在要把这下面这些代码设置成每行4个图片的。请问怎么设置?
<ul class="topimg" style="border-bottom:1px dashed #ccc;"><div style="float:left;margin:5px 5px 0 5px;"><a href="<%If html=1 then Response.Write("List.asp?ID="&rs("ID")&"") else:if html=2 then Response.Write("Html/?"&rs("ID")&".html") else:if html=3 then Response.Write("Html/"&rs("ID")&".html") End if%>" target="_blank"><img src="<%=rs("Images")%>" style="width:90px;height:90px;" title="<%=rs("Title")%>" /></a><p><a href="<%If html=1 then Response.Write("List.asp?ID="&rs("ID")&"") else:if html=2 then Response.Write("Html/?"&rs("ID")&".html") else:if html=3 then Response.Write("Html/"&rs("ID")&".html") End if%>" target="_blank" title="<%=rs("Title")%>" >
<%if rs("TitleFontColor")<>"" then Response.Write("<font style=""color:"&rs("TitleFontColor")&""">"&left(rs("Title"),9)&"</font>") else Response.Write(""&left(rs("Title"),9)&"") end if%></a>
                </p></div></ul>


<%
        rs.movenext
    else
         exit for
    end if
next
%>
                </ul>
            </div>
<div id="clear"></div>
<div id="page">
    <ul>
    <%=mypage.showpage()%>
    </ul>
</div>
        </div>
<%
rs.close
set rs=nothing
end if
%>
    </div>
    <div id="nw_right">
        <%Call ShowAD(3)%>
        <div id="web2r">
            <h5>本类热门</h5>
            <ul id="list10">
                <%Call ShowArticle(ID,10,5,"",100,"no","Hits desc,ID desc",0,0,1)%>
            </ul>
          </div>
        <div id="web2r">
            <h5>图片推荐</h5>
            <ul class="topimg">
                <%Call ShowImgArticle(ID,4,10,"no","DateAndTime desc,ID desc")%>
            </ul>
          </div>
    </div>
</div>
<%=Copy%>
<%
rsclass.close
set rsclass=nothing
end if%></div>
</body>
</html>
搜索更多相关主题的帖子: 图片 sql request include where 
2012-03-04 19:21
jonathen
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:32
专家分:134
注 册:2012-2-14
收藏
得分:0 
用ul当然是竖排的呀  你直接用div好了 一个div中放四张图片就可以了!
2012-03-04 20:12
znmw
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2011-3-6
收藏
得分:0 
谢谢你的解答,用div也是一样的。还是像上面图片一样的。不行呀。

俺不高手,俺也是来学习的。
2012-03-04 22:07
znmw
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2011-3-6
收藏
得分:0 
谢谢jonathen,修改好了,多了一个代码在里面。

俺不高手,俺也是来学习的。
2012-03-04 23:03
快速回复:请问怎么设置一行4个图片?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040959 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved