【问题标题】:cross browseing ie交叉浏览即
【发布时间】:2012-02-27 20:25:31
【问题描述】:

我有this email creative。底部的框在 ff 和 chrome 上都可以,但是在 IE 中就有点奇怪了。

为了让底部框正确显示,我需要在代码中添加/删除什么?

谢谢。

代码如下:

    <title></title>
<style type="text/css">
p
        {
    margin: 0px;
    padding: 0px;
    text-align: right;
        }

        a:link
        {
            color: #990000;
            text-decoration: none;

        }
        a:visited
        {
            text-decoration: none;
            color: #990000;
        }
        a:hover
        {
            text-decoration: none;
            color: #990000;
        }
        img
        {
            border: none;
        }
        body{

            margin:0px;
        }
        </style>
<div style="text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 13px;background-color: #EEF3FA">
    <div style="text-align: right; font-family: Arial, Helvetica, sans-serif; font-size: 13px;background-color: #FFF;width: 720px;margin: 0px auto;">
    <br />
    <table align="center" border="0" cellpadding="4" cellspacing="0" dir="rtl" width="700">
        <tbody>
            <tr>

                <td colspan="3">
                    <a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/head.jpg" style="margin-bottom: 10px;" /></a></td>
            </tr>
            <tr>
                <td colspan="3" style="border:2px #060">
                    <a href="http://www.shvoong.co.il/minisites/kfarsaba/" target="_blank"><img src="Images/tophaedr1.jpg" style="margin-bottom: 10px;margin-right:23px;" /></a></td>
            </tr>

            </table>
            <table align="center" border="0" cellpadding="4" cellspacing="0" dir="rtl" width="700" style="margin-right:17px;">

                <!-- right -->
                <tr>
                <td valign="top" width="156" height="500">

    <table width="156" cellpadding="0" cellspacing="0" border="0"
    style="background-color: B4D336">
    <tr>
    <td width="14" valign="top"><img src="Images/rounded_corner2.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>

    <td width="14" valign="top"><img src="Images/rounded_corner1.gif" width="14"
    height="14" border="0" alt="..." /></td>

    </tr>

<tr>





</tr>
<tr>

<td width="14" valign="bottom"><img src="Images/rounded_corner4.gif" width="14" height="14"
border="0" alt="..." /></td>

<td></td>

<td width="14" valign="bottom"><img src="Images/rounded_corner3.gif" width="14" height="14"
border="0" alt="..." /></td>

</tr>

</table>

            <table width="156" cellpadding="0" cellspacing="0" border="0"
    style="background-color: 3778BC;margin-top: 10px;">
    <tr>
    <td width="14" valign="top"><img src="Images/rounded_corner2_b.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>

    <td width="14" valign="top"><img src="Images/rounded_corner1_b.gif" width="14"
    height="14" border="0" alt="..." /></td>

    </tr>
<tr>







</tr>
<tr>

<td width="14" valign="bottom"><img src="Images/rounded_corner4_b.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>

    <td width="14" valign="bottom"><img src="Images/rounded_corner3_b.gif" width="14"
    height="14" border="0" alt="..." /></td>

</tr>
</table>





                </td>
                    <td valign="top" width="156" >


                <table width="156" cellpadding="0" cellspacing="0" border="0"
    style="background-color: 3778BC">
    <tr>
    <td width="14" valign="top"><img src="Images/rounded_corner2_b.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>

    <td width="14" valign="top"><img src="Images/rounded_corner1_b.gif" width="14"
    height="14" border="0" alt="..." /></td>

    </tr>
<tr>







</tr>
<tr>

<td width="14" valign="bottom"><img src="Images/rounded_corner4_b.gif" width="14" height="14"
border="0" alt="..." /></td>

<td></td>

<td width="14" valign="bottom"><img src="Images/rounded_corner3_b.gif" width="14" height="14"
border="0" alt="..." /></td>

</tr>
</table>

                <table width="156" cellpadding="0" cellspacing="0" border="0"
    style="background-color: B4D336;margin-top: 10px;">
    <tr>

    <td width="14" valign="top"><img src="Images/rounded_corner2.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>

    <td width="14" valign="top"><img src="Images/rounded_corner1.gif" width="14"
    height="14" border="0" alt="..." /></td>

    </tr>
<tr>






</tr>
<tr>


<td width="14" valign="bottom"><img src="Images/rounded_corner4.gif" width="14" height="14"
border="0" alt="..." /></td>

<td></td>

<td width="14" valign="bottom"><img src="Images/rounded_corner3.gif" width="14" height="14"
border="0" alt="..." /></td>

</tr>
</table>



                </td>
                                <td valign="top" width="156">

    <table width="156" cellpadding="0" cellspacing="0" border="0"
    style="background-color: B4D336">
    <tr>

    <td width="14" valign="top"><img src="Images/rounded_corner2.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>

    <td width="14" valign="top"><img src="Images/rounded_corner1.gif" width="14"
    height="14" border="0" alt="..." /></td>

    </tr>
<tr>





</tr>
<tr>


<td width="14" valign="bottom"><img src="Images/rounded_corner4.gif" width="14" height="14"
border="0" alt="..." /></td>

<td></td>

<td width="14" valign="bottom"><img src="Images/rounded_corner3.gif" width="14" height="14"
border="0" alt="..." /></td>

</tr>
</table>

                <table width="156" cellpadding="0" cellspacing="0" border="0"
    style="background-color: 3778BC;margin-top: 10px;">
    <tr>
    <td width="14" valign="top"><img src="Images/rounded_corner2_b.gif" width="14" 
    height="14" border="0" alt="..." /></td>

    <td width="172"></td>


    <td width="14" valign="top"><img src="Images/rounded_corner1_b.gif" width="14"
    height="14" border="0" alt="..." /></td>

    </tr>
<tr>





</tr>
<tr>

<td width="14" valign="bottom"><img src="Images/rounded_corner4_b.gif" width="14" height="14"
border="0" alt="..." /></td>

<td></td>


<td width="14" valign="bottom"><img src="Images/rounded_corner3_b.gif" width="14" height="14"
border="0" alt="..." /></td>

</tr>
</table>




                </td>
                <!-- space -->

                <!-- left -->
                <td  valign="top" width="180">
                <table width="180" cellpadding="0" cellspacing="0" border="0"
style="background-color: B4D336">

<tr>

<td></td>

<td align="center"><a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/left.jpg" width="180" 
height="188" border="0" alt="..." /></a></td>

<td></td>

</tr>

</table>
                        <table width="180" cellpadding="0" cellspacing="0" border="0"
style="background-color: B4D336">

<tr>


<td></td>

<td align="center"><a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/left.jpg" width="180" 
height="188" border="0" alt="..." /></a></td>

<td></td>

</tr>

</table>
                        <table width="180" cellpadding="0" cellspacing="0" border="0"
style="background-color: B4D336">

<tr>

<td></td>


<td align="center"><a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/left.jpg" width="180" 
height="188" border="0" alt="..." /></a></td>

<td></td>

</tr>

</table>
                    <table width="180" cellpadding="0" cellspacing="0" border="0"
style="background-color: B4D336">

<tr>

<td></td>

<td align="center"><a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/left.jpg" width="180" 
height="188" border="0" alt="..." /></a></td>


<td></td>

</tr>

</table>
            </table>
                <table align="center" border="0" cellpadding="4" cellspacing="0" dir="rtl" width="700">
        <tbody>
            <tr>
                <td colspan="3">
                    <a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/pre.jpg" style="margin-bottom: 10px; margin-left: 8px; margin-top: -20px;" /></a></td>

                    <td colspan="3">
                    <a href="http://www.shvoong.co.il/" target="_blank"><img src="Images/logoleft.gif" style="margin-bottom: 10px; margin-left: 11px; margin-top: -10px;" /></a></td>
            </tr>


            </table>
            </div>
</div>

【问题讨论】:

  • 所以这是应该在电子邮件中收到的 HTML?
  • ...在这种情况下,在 IE 中进行测试并不是您可以做的有用的事情

标签: html cross-browser


【解决方案1】:

您可能希望停止使用表格进行布局。

【讨论】:

    【解决方案2】:

    首先,我强烈建议停止使用&lt;table&gt; 标记来构建页面。这就是&lt;div&gt; 的用途。

    已知 IE 存在问题,通常我会使用星号 (*) 标记添加仅适用于 IE 的自定义 CSS 规则。

    #myDiv{
        position: relative;
        top: 20px;
        left: 10px;
        *top: 15px; /* Should be read only be IE */
        *left: 8px; /* Should be read only be IE */
    }
    

    【讨论】:

    • 这是一个电子邮件广告素材。尽管我们讨厌它,但电子邮件客户端兼容性仍然非常需要表格。
    • 没有注意到 :) 即使 OP 甚至没有 html 标签,即使是电子邮件也应该存在。
    • 问题出在tbody上,我可以给tbody一个特定的css吗?另外,由于它是电子邮件广告素材,css 是否适用于客户端电子邮件程序?
    • 不试怎么知道? :)
    • 电子邮件标准项目 (email-standards.org) 是了解所支持内容的绝佳资源
    猜你喜欢
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多