我试图在大屏幕上并排显示列并在移动设备上叠加显示但是我一直无法到目前为止,我尝试遵循相同的方法
ZURB used on their templates,他们添加到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>
在我的< style>标签:
- @media screen and (max-device-width: 600px) {
- .column {
- width: auto !important;
- float: none !important;
- display: block !important;
- }
- }
它看起来几乎无处不在,但是从css到outlook.com apparently strips floats,所以它们并没有并排看待.
我尝试做的事情是使用表格单元格而不是div:
- <table>
- <tr>
- <td width="300" align="left" class="column">
- <!-- content -->
- </td>
- <td width="300" align="left" class="column">
- <!-- content -->
- </td>
- <tr>
- </table>
保持相同的CSS类,但即使它修复了桌面客户端中的问题,它在iOS设备上并排显示(好像显示:块未应用于tds)
有人有想法吗?
解决方法
你应该切换到使用表而不是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>