Jav*_*eva 8 html email-client html-email responsive-design
我试图在大屏幕上并排显示列并在移动设备上叠加显示但是我到目前为止无法实现,我尝试遵循ZURB在他们添加的模板上使用的相同方法到div浮动秒,然后清除在像小型设备的浮动:
<table>
<tr>
<td>
<div class="column" style="float: left; width: 300px;">
<!-- content -->
</div>
<div class="column" style="float: left; width: 300px;">
<!-- content -->
</div>
</td>
<tr>
</table>
Run Code Online (Sandbox Code Playgroud)
在我的<style>标签中:
@media screen and (max-device-width: 600px) {
.column {
width: auto !important;
float: none !important;
display: block !important;
}
}
Run Code Online (Sandbox Code Playgroud)
它看起来几乎无处不在,但outlook.com显然剥离了css中的花车,所以它们不会在那里并排看.
我尝试做的事情是使用表格单元格而不是div像:
<table>
<tr>
<td width="300" align="left" class="column">
<!-- content -->
</td>
<td width="300" align="left" class="column">
<!-- content -->
</td>
<tr>
</table>
Run Code Online (Sandbox Code Playgroud)
保持相同的CSS类,但即使它解决了桌面客户端中的问题,它在iOS设备上并排显示(好像display: block没有应用于tds)
有人有想法吗?
小智 11
您应该切换到使用表而不是div.请查看以下HTML标记以供参考.此外,本指南非常有用:http://www.campaignmonitor.com/guides/mobile/
<table cellpadding="0" cellspacing="0" border="0" width="600">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="300" align="left">
<!-- content -->
</table>
<table cellpadding="0" cellspacing="0" border="0" width="300" align="left">
<!-- content -->
</table>
</td>
<tr>
</table>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13647 次 |
| 最近记录: |