我有一张桌子,这是我的 CSS:
table {
display: block;
height: 500px;
overflow-y: scroll;
}
当我添加这个内联它没问题但在外部不起作用(媒体查询最大宽度 767px)
编辑 | 我的媒体查询
@media(max-width:767px) {
table {
display: block;
height: 500px;
overflow-y: scroll;
}
}
尝试将您的桌子放入div
包装纸中。像这样:
<div class='table-container'>
<table></table>
</div>
然后在你的 CSS 中简单地设置
.table-container > table {
height:100%;
width: 100%;
}
.table-container {
height: 500px;
}
看到这个小提琴
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句