尝试设置 HTML/CSS 表以适应移动屏幕 - 不起作用



我有几个表格,我正在尝试使它们响应,以便表格及其内容缩小到设备的宽度。下面是到目前为止的代码示例。

<table align="center" border="1" cellpadding="15" cellspacing="1" class="toptable;" style="border:none;width:100%;">
<tbody>
    <tr>
        <td align="right"><meta name="viewport" content="width=device-width, initial-scale=1">
        <style type="text/css">*

有人能告诉我为什么@media查询对我不起作用吗?

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

只需更改它的位置即可。

尝试使用 Bootstrap。Bootstrap 提供了一个 12 列的网格,而 bootstrap 的主要优点之一是使用这个 12 列网格制作的网页是响应式的,因此可以非常整齐地适应不同的屏幕尺寸。

您可以从此处下载引导程序。

最新更新