gaolinjie
V2EX  ›  Android

用 android webview 显示 html 效果和浏览器不同

  •  
  •   gaolinjie · Dec 20, 2012 · 14984 views
    This topic created in 4896 days ago, the information mentioned may be changed or developed.
    html 如下:

    <html>
    <head>
    <style type="text/css">body{color: #63656a }</style>
    </head>

    <body link="#C0C0C0" vlink="#808080" alink="#FF0000">
    <table cellpadding="0" cellspacing="0" border="0" width="100%25">
    <tr>
    <td width="24" valign="top" align="left">
    <img src=http://cdn.v2ex.com/avatar/182b/e0c5/33_mini.png?m=1349211100 class="avatar" border="0" align="default"auto />
    </td>
    <td width="10" valign="top"></td>
    <td width="auto" valign="top" align="left">
    <strong>GordianZ</strong>
    <div class="reply_content">这个功能不错 :)</div>
    </td>
    </tr>
    </table>

    <hr style="border: 1px dotted #ccc; width: 100%" />

    <table cellpadding="0" cellspacing="0" border="0" width="100%25">
    <tr>
    <td width="24" valign="top" align="left">
    <img src=http://cdn.v2ex.com/avatar/f782/2db9/14413_mini.png?m=1340727325 class="avatar" border="0" align="default"auto />
    </td>
    <td width="10" valign="top"></td>
    <td width="auto" valign="top" align="left">
    <strong>ywencn</strong>
    <div class="reply_content">1024</div>
    </td>
    </tr>
    </table>

    <hr style="border: 1px dotted #ccc; width: 100%" />

    <table cellpadding="0" cellspacing="0" border="0" width="100%25">
    <tr>
    <td width="24" valign="top" align="left">
    <img src=http://cdn.v2ex.com/avatar/ed79/8eec/12687_mini.png?m=1354005856 class="avatar" border="0" align="default"auto />
    </td>
    <td width="10" valign="top"></td>
    <td width="auto" valign="top" align="left">
    <strong>cutehalo</strong>
    <div class="reply_content">可以直接 @<a href="/member/1024">1024</a> 不 哈哈哈</div>
    </td>
    </tr>
    </table>
    </body>
    </html>

    在浏览器上的效果:


    在 android webview 中效果:


    搞不懂为什么总是前几项用户头像和用户名不在同一行,而到了最后一项又正常了?
    2 replies    1970-01-01 08:00:00 +08:00
    kevan
        1
    kevan  
       Dec 20, 2012
    代码有问题?

    <table cellpadding="0" cellspacing="0" border="0" width="100%25">

    width="100%25">
    Sukizen
        2
    Sukizen  
       Dec 21, 2012
    对TABLE不熟悉。


    .fl { float:right; }

    <ul>
    <li>
    <h3 class="author"><span class="avatar fl"><img /></span></h3>
    <div class="reply_content"></div>
    </li>
    </ul>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3091 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 00:32 · PVG 08:32 · LAX 17:32 · JFK 20:32
    ♥ Do have faith in what you're doing.