html - 中心表 - 颜色任一侧

标签 html css

尝试为电子邮件修复一些问题。问题截图在这里:http://imgur.com/pEQvVqf

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

然而,如您所见,两边都是白色的 - 我该怎么办?做左右两张 table ?并将它们设为灰色,或者我可以让文本保持原样并将表格宽度设为 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>

干杯

最佳答案

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

关于html - 中心表 - 颜色任一侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18020107/

相关文章:

html - 如何使表格响应移动宽度并编写媒体查询

html - CSS:四个div动态共享父级的高度

html - Bootstrap 导航栏默认

php - 根据 php echo 值更改 td bg 颜色

javascript - Selenium v​​ia Java - 单击复选框与手动单击不同的响应

jquery - 重叠类并在其上单击事件

javascript - 滚动时查找 div 元素的可见高度

html - 如何将圆形径向渐变稍微移动到顶部?

html 背景图像在桌面浏览器上显示正确,而不是在移动设备上

javascript - 如何开玩笑地在非内联样式 CSS 上创建测试