html - 媒体查询不适用于 iOS

标签 html ios css media css-tables

在 iOS 上使用媒体查询时,我一直遇到表格不想更改(其他一切都应该按比例缩放)的问题,它在 Android 手机和平板电脑上完美运行,但在 iOS 上却不行。我尝试添加视口(viewport)元标记,但没有帮助。谁知道怎么修它? 部分媒体查询不起作用:

table, thead, tbody, th, td, tr { 
display: block;
max-width:100%; 
 }
th{
display:none;
}

td { 
border: none; 
position: relative;
padding-left: 50%; 
font-size: 1em;
background-color: #F6F7FB;
}

td:before { 
position: absolute;
top: 6px;
left: 6px;
width: 45%; 
padding-right: 10px; 
white-space: nowrap;
line-height: 4em;
vertical-align: middle;
font-weight: bold;
}
  td:nth-of-type(2):before { content: "test"; }
 td:nth-of-type(3):before { content: "test"; }
 td:nth-of-type(4):before { content: "test"; }
 td:nth-of-type(5):before { content: "test"; }
 td:nth-of-type(6):before { content: "test"; }
 td:nth-of-type(7):before { content: "test"; }

最佳答案

我不确定,但对我来说改变显示是不正确的。在大多数情况下,表格中的相对/绝对位置也不起作用。您是否可以将表格结构更改为带有显示表格和表格单元格的 div 结构?我总是这样做,当需要使一些大表响应并且没有问题时

关于html - 媒体查询不适用于 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42462248/

相关文章:

html - 使用第 nth-child 样式化一个 div

Java:JScrollPane JLabel 太靠近边缘

javascript - 如何摆脱 "margin"

ios将音视频url保存到文档目录

html - CSS :Not attribute

css - 在 <mat-list-item> 中使用多个 <mat-chip> 标签

javascript - 简单的 jQuery - 命名函数然后调用它

javascript - 我在 html 页面上有很多图像 - 我怎样才能让某些图像首先加载(或某些图像最后加载)?

ios - UIImage 未保存在文档目录中并终止应用程序

ios - 当 ionic 2 页面完全加载时运行函数