materialize css: Always show side-nav even on mobile?

谁说我不能喝 提交于 2019-12-11 01:45:47

问题


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.


回答1:


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;
}


来源:https://stackoverflow.com/questions/38411933/materialize-css-always-show-side-nav-even-on-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!