【发布时间】:2021-03-06 19:45:50
【问题描述】:
使用tachyons css 库:
我不明白ns 断点是如何工作的。根据文档,断点定义为:
Media Query Extensions:
-ns = not-small [ @media screen and (min-width: 30em) ]
-m = medium [ @media screen and (min-width: 30em) and (max-width: 60em) ]
-l = large [ @media screen and (min-width: 60em) ]
认为下面的代码将确保只有单个 div 的可见性取决于宽度。
<div class="dn-ns dn-m dn-l">Mobile</div>
<div class="dn db-ns">Small</div>
<div class="dn db-m">Medium</div>
<div class="dn db-l">Large</div>
但是,ns 断点似乎也出现在 medium 和 large 断点处。
mobile breakpoint, it's default
ns and medium, both kicking in
是不是因为ns 断点没有指定上限,所以覆盖了所有非移动设备?
【问题讨论】:
-
是的,宽度为 30em 或以上的任何东西都会在 ns 媒体查询中进行设置。就是说不小。
标签: css responsive-design media-queries tachyons-css