V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
cnsun
V2EX  ›  问与答

求高人指点,如何把下边的单网页代码,实现不同分辨率下自适应大小!因为设计的是按 1920 宽设计的,所以在小分辨率下网页不能完全显示,而且是靠左显示!以下是代码部分:

  •  
  •   cnsun · 2014-08-09 17:47:06 +08:00 · 5303 次点击
    这是一个创建于 3541 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <html>
    <head>
    <title>DRP 系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table id="__01" width="1920" height="897" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td colspan="5">
    <img src="images/DRP_01.jpg" width="1920" height="356" alt=""></td>
    </tr>
    <tr>
    <td>
    <img src="images/DRP_02.jpg" width="532" height="49" alt=""></td>
    <td>
    <a href="/hq/"><img src="images/DRP_03.jpg" width="228" height="49" alt=""></a></td>
    <td>
    <img src="images/DRP_04.jpg" width="52" height="49" alt=""></td>
    <td>
    <a href="/shop/"><img src="images/DRP_05.jpg" width="228" height="49" alt=""></a></td>
    <td>
    <img src="images/DRP_06.jpg" width="880" height="49" alt=""></td>
    </tr>
    <tr>
    <td colspan="5">
    <img src="images/DRP_07.jpg" width="1920" height="492" alt=""></td>
    </tr>
    </table>
    <!-- End Save for Web Slices -->
    </body>
    </html>
    3 条回复    2014-08-16 11:20:38 +08:00
    lijsh
        1
    lijsh  
       2014-08-09 17:54:09 +08:00
    table的width和height都被写成了行内样式,如果要改成自适应,首先把行内样式的width和height取消,然后根据媒体查询设置不同宽度,最后优化下图片(设置max-width之类),就差不多了。
    ibolee
        2
    ibolee  
       2014-08-09 21:02:45 +08:00 via Android
    楼上 max-width正解,具体可以参考下国外自适应网站的css样式怎么写。
    cnsun
        3
    cnsun  
    OP
       2014-08-16 11:20:38 +08:00
    @ibolee 感谢两位,可惜我是个小白!
    @lijsh 感谢两位,可惜我是个小白!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2902 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:54 · PVG 15:54 · LAX 00:54 · JFK 03:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.