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

              
                <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<header>
<nav>
 <div class="drawer">
 <!--- いわゆるロゴ ------>
   <div id="logo"><a href="#">LOGO</a></div>
   <!--- いわゆるロゴ ------>
 
<!-- ハンバーガーメニュー部分 --> 
<div class="Toggle">
  <span></span>
  <span></span>
  <span></span>
</div>
  </div>
 <!-------------- drawer ここまで-->
 
 <div class="menu">
  <ul>
   <li><a href="#">Home</a></li>
   <li><a href="#">About</a></li>
   <li><a href="#">Service</a></li>
   <li><a href="#">access</a></li>
  </ul>
 </div>
</nav>
</header>

              
            
!

CSS

              
                
#logo {
  max-width:50%;
  display:block;
  margin:0 auto;
  
}


nav{
 width: 100%;
 height: 70px;
 position: relative;
 background: #F6F6F6;
  
}
.drawer{
 display: flex;
 flex-direction: row;
 align-items: center;
 justify-content: space-between;
 position: relative;
 height: 70px;
 padding: 0 1em;
}

/*ナビゲーション部分*/

.menu ul li a {
display:block;
  font-weight:bold;
padding: 2em;
border-bottom: 1px dotted #CCC;
  color:#333;
  text-decoration:none;
}


.menu ul li a:hover
{background-color:rgba(0,0,0,0.5);
color:orange;}


.menu{
  text-align:center;
  background-color:rgba(255,255,255,0.5);
  transition: .5s ease;/*滑らかに表示*/
  -webkit-transform: translateX(-105%);
  transform: translateX(-105%);/*左に隠しておく*/
}


/*OPEN時の動き*/
.menu.open {
 -webkit-transform: translateX(0%);
 transform: translateX(0%);/*中身を表示(右へスライド)*/

}



/*トグルボタンのスタイルを指定*/
.Toggle {
    display: block;
    position: fixed;    /* bodyに対しての絶対位置指定 */
    width: 42px;
    height: 42px;
    cursor: pointer;
    z-index: 3;
  right:15px;
}
 
.Toggle span {
    display: block;
    position: absolute;
    width: 50px;
    border-bottom: solid 4px #333;
    -webkit-transition: .35s ease-in-out;	/*変化の速度を指定*/
    -moz-transition: .35s ease-in-out;		/*変化の速度を指定*/
    transition: .35s ease-in-out;			/*変化の速度を指定*/
 
}
 
.Toggle span:nth-child(1) {
    top:5px;
}
 
.Toggle span:nth-child(2) {
    top: 18px;
}
 
.Toggle span:nth-child(3) {
    top: 32px;
}
 


.Toggle.active span:nth-child(1) {
    top: 18px;
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    transform: rotate(-45deg);
}
 
/* 2番目と3番目のspanを45度に */
.Toggle.active span:nth-child(2),
.Toggle.active span:nth-child(3) {
    top: 18px;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    transform: rotate(45deg);
}



@media screen and (min-width: 600px) {
  
  header::after{
    
    display:none;
  } 
  
  
nav{
 display: flex;

}
.Toggle{
 display: none;
}
.menu{
 width: 100%;
  background-color: transparent;
  margin-top:0;
 -webkit-transform: translateX(0);
 transform: translateX(0);
}
.menu ul{
 height: 70px;
 display: flex;
 flex-wrap: wrap;
 justify-content: flex-end;
 align-items: center;
}
.menu ul li a{
 padding: 0 1em;
 border-bottom: none;

}
  
  .menu ul li a:hover
{
  background-color:transparent;
}
  
  
}
              
            
!

JS

              
                
$(function() {
 $('.Toggle').click(function() {
   $(this).toggleClass('active');
  $('.menu').toggleClass('open');
 });
});


              
            
!
999px

Console