semantic-ui: how to hide element on mobile only?(语义-UI:如何仅在移动设备上隐藏元素?)
本文介绍了语义-UI:如何仅在移动设备上隐藏元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只需要在移动设备上隐藏一些元素,例如图像。如何使用语义用户界面实现这一点?
角材质中是否有"Hide-X",引导中是否有"Hide-X"?
我通读了文档,但找不到任何类似的东西。我找到的所有内容都是some options for a grid,但我不想使用网格,只是为了使元素在某些设备上不可见...
<div class="ui grid">
<div class="two column mobile only row">
<div class="column">
<div class="ui segment">
Mobile only
</div>
</div>
</div>
</div>
我还发现了some solution here on SO,其中有人建议编写一些额外的CSS。如下所示:
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
[class*="tablet only"]:not(.mobile),
[class*="computer only"]:not(.mobile),
[class*="large monitor only"]:not(.mobile),
[class*="widescreen monitor only"]:not(.mobile),
[class*="or lower hidden"] {
display: none !important;
}
}
真的要走这条路吗?谢谢您的点子。
推荐答案
是,您需要使用grid
或覆盖样式。这是进入语义用户界面的唯一方法。
这在mobile only
类定义中很明显。
@media only screen and (max-width: 991px) and (min-width: 768px) {
.ui[class*="mobile only"].grid.grid.grid:not(.tablet),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.tablet),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.tablet),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.tablet) {
display: none !important;
}
}
@media only screen and (max-width: 1199px) and (min-width: 992px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
}
@media only screen and (max-width: 1919px) and (min-width: 1200px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
}
@media only screen and (min-width: 1920px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
}
希望这能有所帮助。
这篇关于语义-UI:如何仅在移动设备上隐藏元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:语义-UI:如何仅在移动设备上隐藏元素?


猜你喜欢
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01