Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head>
  <script src="https://webrazrab.ru/sitetemplate/jquery-2.2.4.min.js"></script>
</head>
<body>
 <span class="menu-toggle"><svg viewBox="0 0 448 512" width="100" title="bars">
  <path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" />
</svg></span>
<nav id="top-menu" class="top-menu">
	<ul class="parent">
		<li><a href="#">Пункт 1</a>
			<span class="togg"></span>
			<div class="child">
				<ul>
					<li><a href="#">Подпункт 1</a></li>
					<li><a href="#">Подпункт 2</a></li>
					<li><a href="#">Подпункт 3</a></li>
				</ul>
			</div>
		</li>
		<li><a href="#">Пункт 2</a></li>
		<li><a href="#">Пункт 3</a>
			<span class="togg"></span>
			<div class="child">
				<ul>
					<li><a href="#">Подпункт 4</a></li>
					<li><a href="#">Подпункт 5</a></li>
					<li><a href="#">Подпункт 6</a></li>
					<li><a href="#">Подпункт 7</a></li>
					<li><a href="#">Подпункт 8</a></li>
				</ul>
			</div>
		</li>
		<li><a href="#">Пункт 4</a></li>
	</ul>
</nav>
  
</body>
</html>
              
            
!

CSS

              
                body {background:url('https://webrazrab.ru/demo/tinyslider2/photos/4.jpg');background-size:cover;margin:0}
.top-menu {background:#fff}
.menu-toggle {display:none;}
.top-menu ul {
  list-style-type: none;
  padding-left: 0px;
  margin: 0px;
}
.top-menu ul li {position: relative;}
.top-menu .child {
  background: rgba(255, 255, 255, 0.4);
  border-radius:0px 0px 5px 5px;
  max-height: 0px;
  overflow: hidden;
  transition: all 0.5s ease 0s;
  -moz-transition: all 0.5s ease 0s;
  -webkit-transition: all 0.5s ease 0s;
  -o-transition: all 0.5s ease 0s;
}
.top-menu .child ul {
  background: rgba(255, 255, 255, 0.7);
  min-width: 220px;
  box-shadow: 0px 2px 5px #a7a7a7;
  border-radius: 0px 0px 5px 5px;
  margin:10px 4px 4px;
}
.top-menu a {
  display: block;
  padding: 5px 15px;color:#000;
  text-decoration:none;
}
.top-menu .togg {position: absolute;bottom: -8px;left: 50%;margin-left: -2px;}
.top-menu .togg:before {border-top: 4px solid #f44242;border-left: 4px solid transparent;border-right: 4px solid transparent;content: '';display: block;}
.top-menu .togg.active {transform: rotate(180deg);}
.togg, a, ul {transition: all 0.5s ease 0s;-moz-transition: all 0.5s ease 0s;-webkit-transition: all 0.5s ease 0s;-o-transition: all 0.5s ease 0s;}
@media (min-width: 992px) {
	.top-menu .parent > li {float: left;}
	.top-menu li:hover .child {max-height:1000px;}
	.top-menu ul:after {display:block;content:'';clear:both;}
	.top-menu .child {position: absolute;top: 100%;left: 0px;}
  .top-menu li > .togg:before {opacity:0.5}
	.top-menu li:hover > .togg {transform: rotate(180deg);z-index:10}
  .top-menu li:hover > .togg:before {opacity: 1;}
	.top-menu li:hover > a {color: #d60400}
}
@media (max-width: 991px) {
	.menu-toggle {display:block;}
  .menu-toggle svg {
    padding: 5px;background:rgba(255,255,255,0.5);
    border-radius: 5px;width: 40px;
  }
	.top-menu {display:none;position:absolute;height:80%;overflow:auto;left:0;right:0}
	body.menuopen {width: 100%;height: 100%;overflow: hidden;}
	.top-menu a {display:inline-block;}
	.top-menu .parent > li {
    border-bottom: 1px dotted #ccc;
    min-height: 36px;
    display: flex;flex-wrap:wrap;
    align-items: center;
  }
  .top-menu .child {width:100%}
	.top-menu .child.open {max-height:1000px}
	.top-menu .togg {
    height: 30px;width: 30px;
    top: 3px;border: 1px solid #5e5e5e;
    bottom: auto;right: 10px;left: auto;
    margin-left: 0px;padding: 10px 5px;
    box-sizing: border-box;border-radius: 30px;
  }
	.top-menu .togg:before {
    border-top: 10px solid #ec3437;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
  }
}
              
            
!

JS

              
                $(".menu-toggle").click(function () {
	$('#top-menu').toggle().toggleClass('open');
	$('body').toggleClass('menuopen')
});
$('.togg').click(function () {
    if ($(this).hasClass('active')) {
  $(this).removeClass('active').next().removeClass('open');
    } else {
        $(this).addClass('active').next().addClass('open');
    }
});
              
            
!
999px

Console