| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1984 人关注过本帖, 1 人收藏
标题:图片错位怎么解决?
只看楼主 加入收藏
drplay009
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-4-18
结帖率:0
收藏(1)
已结贴  问题点数:20 回复次数:1 
图片错位怎么解决?
asp做的适应屏幕宽度的网页,显示图片时有几行错位,好像是满屏下面的图片(图片大小略有不同)!求解!
<div style="width:100%;margin-top:40px; margin-left:0; padding:0; overflow:hidden">
 <%
         set rs=server.CreateObject("adodb.recordset")
             sql="select * from artical where dlei="&zpzs&" order by  id desc "
         Set rs.ActiveConnection = conn
             rs.CursorType = 3
             rs.Open sql,conn,1,1
         if  rs.bof and rs.eof then
               response.Write("<TR><TD align='center'>暂时没有数据</TR></TD>")
         else
         '设置每页显示10行记录
             rs.PageSize =10
         '读取参数
             page = CInt(Request.QueryString("page"))
         '处理无效页码
         If  page < 1 Then
             page = 1
         End If
         If page > rs.PageCount Then
            page = rs.PageCount
         End If
         '设置当前页
            rs.AbsolutePage = page
            m=cint((page-1)*10)+1
         For i = m To rs.PageSize*page
      %>
     <div style="width:49.9%;background-color: #FFF; text-align:center;height:auto; display:inline; float:left;">
      <div style="width:100%;  bottom:0; top:0; text-align:center">

   <a  href="mjsnr.asp?id=<%=rs("id")%>" ><img src="<%=rs("pic")%>" width="99%" height="auto"   border="0" alt="<%=rs("ztitle")%>" /></a>
          </div>
         
          <div style="width:100%; height:30px; text-align:center; line-height:30px; float:left">
         
           <a  href="msnr.asp?id=<%=rs("id")%>" target="_blank" art="<%=rs("ztitle")%>"><strong><font size="3" font-family:="font-family:" "Microsoft yahei="Yahei"", "STHeiti", "SimSun", "Arail", "Verdana", "Helvetica", "sans-serif" color="#171717"> <%=rs("ztitle")%></font></strong></a>
         
          </div>
     </div>
    <%
         rs.MoveNext
       '如果已经到达记录集结尾,则退出循环
      If rs.EOF Then Exit For
      Next
      end if
     %>
 </div>


 <div style="width:100%; height:30px; line-height:30px; text-align:center; background-color: #CCC; border-bottom:1px solid #000; float:left">
 <span><font color="#000000">共 <%=rs.recordCount%>项

  当前页码:<%=page%>/<%=rs.PageCount%>
                      <%
 '设置“第一页”链接   
  If page = 1 Then
    Response.Write("第一页 ")
  Else
    Response.Write(" <a href=?zpzs="&zpzs&"" & url &">第一页</a> ")
  End If
  '设置“上一页”链接
  If page = 1 Then
    Response.Write(" 上一页 ")
  Else
    Response.Write(" <a href=?zpzs="&zpzs&"&page="&page-1&">上一页</a> ")
  End If
  '设置“下一页”链接
  If page = rs.PageCount Then
    Response.Write(" 下一页 ")
  Else
    Response.Write(" <a href=?zpzs="&zpzs&"&page="&page+1&">下一页</a> ")
  End If
  '设置“最后一页”链接
  If page = rs.PageCount Then
    Response.Write(" 最后一页 ")
  Else
    Response.Write(" <a href=?zpzs="&zpzs&"&page="&rs.PageCount&">最后一页</a> ")
  End If

%>
    </font></span>
</div>

搜索更多相关主题的帖子: hidden style where 图片 网页 
2015-04-18 15:40
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:20 
图片错位,你自己定制宽度、高度。


response.end,一步一步调试。

ASP讨论QQ群:251346273
2015-04-20 09:49
快速回复:图片错位怎么解决?
数据加载中...
 
   



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

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