【发布时间】:2014-05-01 12:13:26
【问题描述】:
我创建了一个响应式 HTML 时事通讯。所有图像都包含在一个表格中。在一个小显示器上,我希望桌子彼此叠放。在更宽的显示器上,表格应连续显示。它在 Chrome 中运行良好,但在 Firefox 中却不行。下面我粘贴了整个 HTML,我想创建一个小提琴,但在小提琴中它工作正常,非常混乱。
HTML
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>float image</title>
<style type="text/css">
table {border-collapse: collapse;}
td {font-family: arial, sans-serif; color: #333333;}
@media only screen and (max-width: 620px) {
body,table,td,p,a,li,blockquote {
-webkit-text-size-adjust:none !important;
}
table {width: 100% !important;}
td[class="scale_img"] img{
height: auto !important;
max-width: 400px !important;
width: 100% !important;
}
}
}
</style>
</head>
<body style="margin:0; padding:10px 0;" bgcolor="#ededed" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#ebebeb" width="100%">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="600" bgcolor="#FFFFFF">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" align="left" width="32%">
<tbody>
<tr>
<td style="padding: 0 18px 0 18px;" align="center" class="scale_img">
<img src="http://projector.buyingguide.com.au/images/225_on_16_9.jpg" width="160" alt="">
</td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" align="left" width="32%">
<tbody>
<tr>
<td style="padding: 0 18px 0 18px;" align="center" class="scale_img">
<img src="http://projector.buyingguide.com.au/images/225_on_16_9.jpg" width="160" alt="">
</td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" align="left" width="32%">
<tbody>
<tr>
<td style="padding: 0 18px 0 18px;" align="center" class="scale_img">
<img src="http://projector.buyingguide.com.au/images/225_on_16_9.jpg" width="160" alt="">
</td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="font-size: 0; line-height: 0;" height="20"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
【问题讨论】:
-
根据您给定的示例,如果我将减少显示,那么将只有一个表。所以您在媒体查询中写了什么..?如果窗口调整大小,你只想要一个?
-
向右滚动然后你会看到另外两个表
-
嘿...如果我必须向左滚动,那我怎么能说它的响应性,因为不能有水平滚动条??