物化css:即使在移动设备上也始终显示侧导航 [英] materialize css: Always show side-nav even on mobile?

查看:205
本文介绍了物化css:即使在移动设备上也始终显示侧导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用materialize css。我使用侧导航和想要设置可见即使在移动。我使用以下代码,但它不工作。

I am using materialize css. I'm using side nav and want to set visible even on mobile. I'm using following code for this but its not working.

@media only screen and (max-width: 992px) {
    .side-nav{
        visibility: visible;
        opacity: 100;
    }
}

它保持隐藏在小屏幕上。

Its keep on hiding on small screen.

推荐答案

Materialise使用CSS转换来显示/隐藏边导航,因此更改可见性或不透明度不会帮助你。一个非常快的解决方案只是将translateX转换固定为0.这将使您的导航随时可见。

Materialize uses CSS transformations to show/hide the side nav, so altering the visibility or opacity will not help you here. A very quick solution is just to fix the translateX transformation at 0. This should make your nav visible at all times.

.side-nav {
    transform: translateX(0%) !important;
}

这篇关于物化css:即使在移动设备上也始终显示侧导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆