我有左侧和右侧离子菜单,我想改变两个菜单宽度。我已经成功地改变了左侧菜单宽度,如下所示,但我不知道如何改变右侧菜单宽度。目前,左侧菜单宽度改变,但当右侧菜单被切换时,右侧菜单内容被扭曲。
.menu.menu-left{
width: calc(100% - 70px) !important;
}
.menu-open .menu-content{
transform: translate3d(calc(100% - 70px), 0px, 0px) !important;
}
我有左侧和右侧离子菜单,我想改变两个菜单宽度。我已经成功地改变了左侧菜单宽度,如下所示,但我不知道如何改变右侧菜单宽度。目前,左侧菜单宽度改变,但当右侧菜单被切换时,右侧菜单内容被扭曲。
.menu.menu-left{
width: calc(100% - 70px) !important;
}
.menu-open .menu-content{
transform: translate3d(calc(100% - 70px), 0px, 0px) !important;
}
6条答案
按热度按时间2vuwiymt1#
只需在
variables.scss
中添加“menu-width”2fjabf4q2#
使用类别名称变更侧边功能表的长度。
在CSS中,您可以使用如下所示。
qojgxg4l3#
For Ionic5 and above projects, we can overwrite the side panel's CSS like below to make it customized as per requirements.
Put this class where you implemented your menu so it will overwrite existing CSS with this.
oxosxuxt4#
根据this只需在
ion-side-menu
元素中添加width
属性即可。侧菜单的离子文档为here
mutmk8jj5#
As people gave their answer I wish to give it mine too.
PX is good but if we add width in percentage then its works with every device. add this scss on your page.scss file
And the HTML does not need to give a class name or anything, you can give it if you want.
i7uaboj46#
将其放入:变量的根目录.scss
例如:
并将其设置为