【发布时间】:2015-03-19 08:26:03
【问题描述】:
我正在尝试使用电子邮件的媒体查询创建响应式两列行(在表格中)。左列当前与左对齐,右列当前与中心对齐。我希望在移动设备上看到左列居中,右列保持对齐中心状态。右列将开始一个新行。
这是我的代码的一部分:
`<style>
@media only screen and (max-width: 40em) {
.deviceWidth {width:100%!important;float:center!important;}
table, thead, tbody, tfoot, th, td, tr {display:block!important;}
.header{width:100%!important; display:block!important; align:center!important;}
}
</style>
<table cellpadding="0" cellspacing="0" width="100%" style="border-top:1px solid #e5e5e5; text-align:center;" class="deviceWidth">
<tr>
<td class="header" width="50%" align="left">
<img src="" />
</td>
<td class="header" width="50%" align="center" style="padding:5px; font-family:Arial,Helvetica,sans-serif; font-size:11px; color:#000000">
Text
</td>
</tr>
</table>`
有谁知道为什么左栏不响应中心
【问题讨论】:
标签: responsive-design media-queries html-email