中心桌 - 颜色任一侧

时间:2013-08-02 14:59:03

标签: html css

尝试修复电子邮件的内容。问题的屏幕截图:http://imgur.com/pEQvVqf

基本上有一个600宽度的表,我需要与电子邮件的其余部分相同的背景颜色和文本颜色。

然而,正如你看到任何一方都是白人 - 我该怎么办?左右两个表?并使它们变灰或者我可以使文本保持原样并使表格宽度达到100%吗?因为这会扭曲我的文本格式。

任何帮助都非常感激 - 这是我的代码(无法使用4个间距正确格式化,因此使用了反引号:

<table width="600" height="21" border="0" cellspacing="0" cellpadding="0" align="center" style="background-color:#ccc;font-family:verdana; font-size:10px; color:FFFFFF">
    <tr>
        <td colspan="2" align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#000000; padding:10px 10px 0px 10px;">
            <font style="font-family:arial;font-size:10px;">
              You have received this email from an independent marketing company x x x x x x x .Company Reg. No.03976500 You have registered to receive our email advertising from one of our sites, and may unsubscribe from this newsletter by clicking <a href="">here</a><br> For more information on how we use your data, please read our <a href="http:/www.yoy.co.uk/privacy-legal" style="color: #5B5B5B;" target="_blank">privacy policy</a>.
            </font> 
        </td>
    </tr>
</table>

干杯

3 个答案:

答案 0 :(得分:0)

只需使用div标签和一些特殊的CSS类。

<div style="background-color:#ccc;font-family:arial;font-size:10px;">
  <table style="width: 600px;margin:0 auto;font-family:verdana;color:FFFFFF;">...</table>
</div>

答案 1 :(得分:0)

只需添加此css - body:background-color:#123456;

答案 2 :(得分:0)

尝试这样的事情:

<div style="background-color:#ccc; font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#000000; color:#fff; width:100%">
    <div style="width:600px; margin: 0 auto; padding: 10px 10px 0 10px;">
              You have received this email from an independent marketing company x x x x x x x .Company Reg. No.03976500 You have registered to receive our email advertising from one of our sites, and may unsubscribe from this newsletter by clicking <a href="">here</a><br> For more information on how we use your data, please read our <a href="http:/www.yoy.co.uk/privacy-legal" style="color: #5B5B5B;" target="_blank">privacy policy</a>.
    </div>
</div>