html - 电子邮件表格图像居中

标签 html css

我的图像在表格单元格中居中。我试过使用 text-align: left,但是当您在电子邮件中发送它时,图像仍然居中。

.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}
.tg .tg-yw4l {
    vertical-align: top;
}
img {max-width:100%;}
@media screen and (max-width: 767px) {.tg {width: auto !important;}.tg col {width: auto !important;}.tg-wrap {overflow-x: auto;-webkit-overflow-scrolling: touch;}}
<div class="tg-wrap">
    <table class="tg">
        <tr>
            <th class="tg-yw4l">
                <a href="http://www.highprofile-properties.co.uk/"><img src="https://i.imgur.com/ap6gok8.png"></a>

            </th>
            <th class="tg-yw4l">
                <img src="https://i.imgur.com/5YgxaJ3.png" style="margin-top: 5px;margin-bottom:25px;"><br>
                <img src="https://i.imgur.com/hYv3F1R.png" style="margin-bottom:5px;"><br>
                <img src="https://i.imgur.com/hYv3F1R.png" style="margin-bottom:5px;"><br>
                <img src="https://i.imgur.com/acXC4op.png" style="margin-bottom:5px;"><br>
                <img src="https://i.imgur.com/uQVx0nh.png">
            </th>
        </tr>
        
    </table>
    <div style="max-width:600px;font-family:Arial, sans-serif;font-size:12px;color:#838383;">
    <p>The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by any other person is not permitted. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.</p>
    </div>
</div>

谁知道如何让它们左对齐?

最佳答案

你可以试试这个:

img {max-width:100%; float: left;}

.tg  {border-collapse:collapse;border-spacing:0; text-align: left;}

关于html - 电子邮件表格图像居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48168407/

相关文章:

html - css 背景输入和 firefox

php - 哪种方法更有效,是在单引号内使用双引号还是转义单引号?

html - 如何为每个结果正确添加 animation.css?

html - css 显示表的 Colspan 不起作用

css - 在输入字段的垂直对齐方面需要帮助

jquery - 居中 jQuery 模态对话框弹出窗口

java - 边界半径 css 不适用于 Flying Saucer

html - 适合 Firefox 的 960.gs 插件?

html - CSS a-Tag 链接颜色 : Particular change for a class

html - 类 no-gutter/相应的 CSS 不消除列之间的间隙