css Toogle菜单 - 汉堡包

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css Toogle菜单 - 汉堡包相关的知识,希望对你有一定的参考价值。

.nav-toggle .bar {
	height: 4px;
	border-radius: 000px !important;
	background: #111;
	position: absolute;
	left: 50%;
	margin-left: -15px;
	top: 50%;
	-webkit-transition: opacity .2s linear .2s, margin .2s linear .2s, -webkit-transform .2s linear 0s;
	-moz-transition: opacity .2s linear .2s, margin .2s linear .2s, -moz-transform .2s linear 0s;
	-o-transition: opacity .2s linear .2s, margin .2s linear .2s, -o-transform .2s linear 0s;
	transition: opacity .2s linear .2s, margin .2s linear .2s, transform .2s linear 0s;
}

.toggles {
	display: block;
	background: none;
	border: none;
	margin-top: 10px;
	z-index: 1002;
	width: 80px;
	margin: 0 auto;
	right: 0;
	bottom: 0;
	top: 0;
	cursor: pointer;
}

.nav-toggle .bar:nth-child(1) {
	margin-top: -15px;
}

.nav-toggle .bar:nth-child(3) {
	margin-top: 5px;
}

.open .nav-toggle .bar:nth-child(1),
.open .nav-toggle .bar:nth-child(3) {
	margin-top: -2px;
}
.mobil-m {
	z-index: 1;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	vertical-align: middle;
	display: flex;
	align-items: center;
	max-height: 0;
	overflow: hidden;
}

ul.mobile-menu {
	display: block !important;
	width: 100%;
	padding: inherit !important;
}

.mobile-menu li {
	border: none;
	text-align: right;
	position: relative;
}

.mobile-menu a {
	position: relative;
	padding: 10px 40px;
	text-align: center;
	display: table;
	margin: 0 auto;
	font-size: 1.2rem;
	left: 0;
	top: -5px;
}

.open .mobil-m {
	max-height: 100vh;
}


.open .nav-toggle .bar {
	background: #ca2017;
	-webkit-transition: opacity 0.2s linear 0s, margin 0.2s linear 0s, -webkit-transform 0.2s linear 0.2s;
	-moz-transition: opacity 0.2s linear 0s, margin 0.2s linear 0s, -moz-transform 0.2s linear 0.2s;
	-o-transition: opacity 0.2s linear 0s, margin 0.2s linear 0s, -o-transform 0.2s linear 0.2s;
	transition: opacity 0.2s linear 0s, margin 0.2s linear 0s, transform 0.2s linear 0.2s;
}

.open .nav-toggle .bar:nth-child(1),
.open .nav-toggle .bar:nth-child(3) {
	margin-top: -2px;
}

.open .nav-toggle .bar:nth-child(1) {
	-webkit-transform: rotate(45deg);
	-moz-transform: rotate(45deg);
	transform: rotate(45deg);
}

.open .nav-toggle .bar:nth-child(2) {
	-webkit-opacity: 0;
	-moz-opacity: 0;
	opacity: 0;
	margin-left: 0;
	display: none;
}

.open .nav-toggle .bar:nth-child(3) {
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	transform: rotate(-45deg);
}

@media screen and (max-height: 600px) {
	

.open .mobile-menu {
    height: 500px;
    overflow: scroll !important;
    /* padding-top: 50px; */
}
	

	
}

以上是关于css Toogle菜单 - 汉堡包的主要内容,如果未能解决你的问题,请参考以下文章

css 在汉堡包图标后添加“菜单”文字

css 在汉堡包菜单上添加“MENU”以获得全屏DIVI

css 汉堡菜单CSS

css 只有CSS的汉堡菜单

汉堡菜单仅使用 CSS 不起作用

javascript js + html + css - 汉堡菜单