LINUX.ORG.RU

Мобильное меню css

 


0

1

Помогите с кодом, не могу разобраться, уже сижу и не понимаю. Имеется css меню на сайт:

/*-----------------Site Navigation-----------------*/

#site-navigation {
	float: right;
}

#site-navigation .menu-toggle {
	display: none;
}

#site-navigation {
  width: auto;
  padding: 8px 0;
}
#site-navigation:before {
  content: '';
  display: block;
}
#site-navigation:after {
  content: '';
  display: table;
  clear: both;
}
#site-navigation ul {
  list-style-type: none;
  position: relative;
  display: block;
  font-size: 14px;
  margin: 0;
  padding: 0;
}
#site-navigation ul:before {
  content: '';
  display: block;
}
#site-navigation ul:after {
  content: '';
  display: table;
  clear: both;
}
#site-navigation li {
	  text-decoration: none;
  border-bottom: 4px solid transparent;
  display: block;
  float: left;
  margin: 0;
  padding: 0;
}
#site-navigation li a {
  float: left;
  text-decoration: none;
  height: 40px;
  padding: 9px 15px;
  font-weight: normal;
}
#site-navigation li:hover,
#site-navigation .active {
  text-decoration: none;
  border-bottom: 4px solid #2196f3;
}
#site-navigation li:hover a {
  color: #fff;
}
#site-navigation .active a {
  color: #fff;
  font-weight: 700;
}


/*-----------------Header Search and Cart-----------------*/
.header-bottom .tg-container {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
}

.header-bottom .site-navigation-wrapper {
	-webkit-box-flex: 6;
	-ms-flex: 6;
	flex: 6;
}

.header-bottom .header-action-container {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
}

.header-bottom .search-wrap {
	float: right;
	padding: 20px 0 20px 40px;
	position: relative;
}

.transparent.header-sticky .search-icon:hover,
.transparent .search-icon:hover {
	border-color: #30afb8;
	color: #30afb8;
}

.header-bottom .search-icon {
	cursor: pointer;
	color: #99a3b0;
	font-size: 14px;
	height: 30px;
	width: 30px;
	line-height: 30px;
	text-align: center;
	border: 1px solid #9ca6b2;
	border-radius: 100%;
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	transition: all 0.5s ease;
}

.header-bottom .search-icon:hover {
	border-color: #30afb8;
	color: #30afb8;
}

.header-bottom .search-box {
	opacity: 0;
	visibility: hidden;
	position: absolute;
	width: 300px;
	top: 100%;
	right: -10px;
	background-color: #fff;
	box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.2);
	padding: 20px;
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	transition: all 0.5s ease;
}

.header-bottom .search-box.active {
	opacity: 1;
	visibility: visible;
	right: 0;
	z-index: 9;
}

.header-bottom .search-box .search-field {
	width: 80%;
	border-right: none;
	border-top: none;
	border-left: none;
	border-bottom: 1px solid #a1a1a1;
}

.header-bottom .search-box button[type="submit"] {
	margin-bottom: 0;
}

.header-bottom .searchform .btn {
	background-color: #30afb8;
}

.header-bottom .searchform .btn:hover {
	background-color: #2299a1;
}

.search-submit .fa {
	color: #fff;
}

.header-bottom .cart-wrap {
	float: right;
	padding: 20px 0 20px 30px;
	position: relative;
}

.header-bottom .flash-cart-views {
	font-size: 14px;
	height: 30px;
	width: 30px;
	line-height: 30px;
	text-align: center;
	border: 1px solid #9ca6b2;
	border-radius: 100%;
}

.header-bottom .flash-cart-views a {
	color: #99a3b0;
	position: relative;
}

.header-bottom .flash-cart-views a span {
	background-color: #30afb8;
	border-radius: 100%;
	font-size: 12px;
	left: 17px;
	height: 20px;
	width: 20px;
	line-height: 20px;
	text-align: center;
	position: absolute;
	top: -10px;
	color: #fff;
}

.header-bottom .widget_shopping_cart {
	opacity: 0;
	visibility: hidden;
	position: absolute;
	top: 100%;
	right: -10px;
	min-width: 250px;
	box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.2);
	background-color: #fff;
	padding: 15px;
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	transition: all 0.5s ease;
	z-index: 99;
}

.header-bottom .widget_shopping_cart ul {
	margin: 0;
}

.header-bottom .widget_shopping_cart ul li {
	text-align: center;
}

.header-bottom .cart-wrap:hover .widget_shopping_cart {
	opacity: 1;
	visibility: visible;
	right: 0;
}

.boxed {
	width: 1200px;
	margin: 0 auto;
}

.boxed .site {
	background: #fff none repeat scroll 0 0;
	box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.3);
	margin: 30px 0;
	position: relative;
}

.boxed .tg-container {
	width: 100%;
	padding: 0 30px;
}

@media (max-width: 980px) {
	.boxed .tg-container {
		width: 98%;
	}
}

.transparent #masthead {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 999;
}

.transparent .header-top {
	background-color: transparent;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
	color: #fff;
}

.transparent .contact-info span,
.transparent .contact-info li {
	color: #fff;
}

.transparent .header-bottom {
	border: none;
	background-color: transparent;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.transparent .logo-text {
	color: #fff;
}

.transparent .logo-text a {
	color: #fff;
}

.transparent.header-sticky #site-navigation ul li:hover > a {
	color: #30afb8;
}

/* НИЖЕ НАХОДИТСЯ КОД МОБИЛЬНОГО МЕНЮ - MOBILE MENU */

.transparent #site-navigation .menu-toggle .fa {
	color: #fff;
}

.transparent #site-navigation ul li .sub-toggle {
	color: #fff;
}

.transparent #site-navigation ul.sub-menu li {
	padding: 0;
}

.transparent #site-navigation ul li a {
	color: #fff;
	display: inline-block;
}

.transparent #site-navigation ul li:hover .sub-toggle {
	color: #30afb8;
}

.transparent #site-navigation ul li:hover a {
	color: #30afb8;
	position: relative;
	visibility: none;
}

.transparent #site-navigation ul.sub-menu li a {
	color: #4c5867;
	padding: 10px 30px;
}

.transparent #site-navigation ul.sub-menu li a:before {
	display: none;
}

.transparent #site-navigation ul.sub-menu li:hover a {
	color: #30afb8;
}

.transparent #site-navigation ul.sub-menu li.menu-item-has-children ul li:hover a {
	color: #30afb8;
}

.transparent #site-navigation ul.sub-menu li.menu-item-has-children ul li a {
	color: #4c5867;
}

.transparent .cart-wrap .flash-cart-views {
	border-color: #fff;
}

.transparent .cart-wrap .flash-cart-views a {
	color: #fff;
}

.transparent .search-wrap .search-icon {
	color: #fff;
	border-color: #fff;
}

.right-logo-left-menu .header-bottom .tg-container {
	-webkit-box-orient: horizontal;
	-webkit-box-direction: reverse;
	-ms-flex-direction: row-reverse;
	flex-direction: row-reverse;
}

.right-logo-left-menu .header-bottom #site-navigation {
	float: left;
}

.right-logo-left-menu .header-bottom .header-action-container {
	margin-right: auto;
}

.right-logo-left-menu .header-bottom .header-action-container .cart-wrap,
.right-logo-left-menu .header-bottom .header-action-container .search-wrap {
	padding-left: 0;
	padding-right: 30px;
}

.right-logo-left-menu .header-bottom .search-box {
	left: -10px;
}

.right-logo-left-menu .header-bottom .search-box.active {
	right: auto;
	left: 0;
}

.right-logo-left-menu .header-bottom .widget_shopping_cart {
	left: 0;
}

.center-logo-below-menu .header-bottom .tg-container {
	display: block;
	text-align: center;
}

.center-logo-below-menu .logo {
	float: none;
}

.center-logo-below-menu .logo .logo-text {
	float: none;
}

.center-logo-below-menu .logo .logo-image {
	float: none;
	padding: 20px 0 0;
	display: inline-block;
}

.center-logo-below-menu #site-navigation {
	float: left;
}

.center-logo-below-menu .header-bottom .header-action-container {
	display: none;
}

.center-logo-below-menu .header-bottom .site-navigation-wrapper {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
}

.center-logo-below-menu .header-bottom .site-navigation-wrapper .header-action-container {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	margin-left: auto;
}

.header-sticky .is-sticky #masthead {
	z-index: 99 !important;
}

.header-sticky .is-sticky .header-bottom {
	background: #fff;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.transparent.header-sticky #masthead-sticky-wrapper {
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: 99;
}

.transparent.header-sticky #masthead {
	left: auto;
}

.transparent.header-sticky .header-top {
	display: none;
}

.transparent.header-sticky .header-bottom {
	background-color: transparent;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.transparent.header-sticky #site-navigation .menu-toggle .fa,
.transparent.header-sticky #site-navigation ul li a {
	color: #fff;
}

.transparent.header-sticky .flash-cart-views a {
	color: #fff;
}

.transparent.header-sticky #site-navigation ul.sub-menu li a {
	color: #333;
}

.transparent.header-sticky #site-navigation ul.sub-menu li a:hover {
	color: #30afb8;
}

.transparent.header-sticky .flash-cart-views {
	border-color: #fff;
}

.transparent.header-sticky .search-icon {
	color: #fff;
	border-color: #fff;
}

.transparent.header-sticky .is-sticky #masthead {
	z-index: 99 !important;
}

.transparent.header-sticky .is-sticky .header-top {
	background: #f1f5f8;
	border: none;
	color: #333;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	transition: all 0.5s ease;
}

.transparent.header-sticky .is-sticky .header-top .contact-info li {
	color: #333;
}

.transparent.header-sticky .is-sticky .header-top .contact-info li span {
	color: #333;
}

.transparent.header-sticky .is-sticky .logo-text {
	color: #333;
}

.transparent.header-sticky .is-sticky .logo-text a {
	color: #333;
}

.transparent.header-sticky .is-sticky #site-navigation ul li a,
.transparent.header-sticky .is-sticky #site-navigation ul.sub-menu li a {
	color: #333;
}

.transparent.header-sticky .is-sticky .flash-cart-views a {
	color: #333;
}

.transparent.header-sticky .is-sticky #site-navigation .menu-toggle .fa {
	color: #333;
}

.transparent.header-sticky .is-sticky #site-navigation ul li .sub-toggle {
	color: #333;
}

.transparent.header-sticky .is-sticky #site-navigation ul li:hover > .sub-toggle {
	color: #30afb8;
}

.transparent.header-sticky .is-sticky .header-bottom {
	background: #fff;
	border: none;
	-webkit-transition: all 0.5s ease;
	-moz-transition: all 0.5s ease;
	transition: all 0.5s ease;
}

.transparent.header-sticky .is-sticky .flash-cart-views {
	border-color: #333;
}

.transparent.header-sticky .is-sticky .search-icon {
	color: #333;
	border-color: #333;
}

.transparent.header-sticky .custom-logo,
.transparent.header-sticky .is-sticky .transparent-logo {
	display: none;
}

.transparent-logo {
	display: none;
}

.transparent .custom-logo {
	display: none;
}

.transparent.header-sticky .is-sticky .custom-logo,
.transparent.header-sticky .transparent-logo {
	display: block;
}

.transparent .transparent-logo {
	display: block;
}

#wp-custom-header-video {
	display: block;
	min-height: 300px;
	min-height: 75vh;
	width: 100%;
}

.wp-custom-header {
	position: relative;
	text-align: center;
}

.wp-custom-header-video-button {
	position: absolute;
	bottom: 0;
	left: 0;
}

Хочу реализовать меню как тут:

https://codepen.io/shieldsma91/pen/zLpbLX

Не могу уже понять, куда вставить данный код?

Класс мобильного меню называется menu-toggle (при 98% от размера экрана при сужении появляется мобильное меню)

P.S. чего-то

[cut]
и
<<<
(как описано в FAQ) не создают спойлер, хотел поместить код под спойлер



Последнее исправление: n199a (всего исправлений: 2)

Первое апреля уже прошло.

beaver
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.