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

              
                <head>
  <meta name="robots" content="noindex,nofollow">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <!--==============レイアウトを制御する独自のCSSを読み込み===============-->
  <link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/s/saz7ehm66llopzw/reset.css?dl=0">
</head>

<body>

  <p class="lead">マウスポインタをメニューの上に持ってきて</p>
  <ul class="gnavi">
    <li class="current"><a href="#"><span>Home</span></a></li>
    <li><a href="#"><span>About</span></a></li>
    <li><a href="#"><span>Service</span></a></li>
    <li><a href="#"><span>Contact</span></a></li>
  </ul>

</body>
              
            
!

CSS

              
                @charset "utf-8";

/*==================================================
共通 横並びのための設定
===================================*/

.gnavi {
  display: flex;
  flex-wrap: wrap; /*スマホ表示折り返し用なのでPCのみなら不要*/
  margin: 0 0 50px 0;
  list-style: none;
}

.gnavi li a {
  display: block;
  padding: 10px 30px;
  text-decoration: none;
  color: #333;
}

/*==================================================
 線が伸びて枠線になる
===================================*/

.gnavi li {
  /*線の基点とするためrelativeを指定*/
  position: relative;
  margin: 0 10px;
}

/*線の基点位置*/
.gnavi li::before,
.gnavi li::after {
  content: "";
  /*絶対配置で線の位置を決める*/
  position: absolute;
  background: rgba(249, 143, 253, 1);
  /*線の形状*/
  width: 0;
  height: 2px;
  /*アニメーションの指定*/
  transition: all 0.2s linear;
}

/* 基点を右下に設定 */
.gnavi li::before {
  right: 0;
  bottom: 0;
}

/* 基点を左上に設定 */
.gnavi li::after {
  left: 0;
  top: 0;
}

/*線の基点位置2 spanタグ*/

.gnavi li span {
  display: block;
}

.gnavi li span::before,
.gnavi li span::after {
  content: "";
  /*絶対配置で線の位置を決める*/
  position: absolute;
  background: rgba(249, 143, 253, 1);
  /*線の形状*/
  width: 2px;
  height: 0;
  /*アニメーションの指定*/
  transition: all 0.1s linear;
}

/* 基点を左下に設定 */
.gnavi li span::before {
  left: 0;
  bottom: 0;
}

/* 基点を右上に設定 */
.gnavi li span::after {
  right: 0;
  top: 0;
}

/*現在地とhoverした際の線の変化*/
/* 横の線 */
.gnavi li.current::before,
.gnavi li.current::after,
.gnavi li:hover::before,
.gnavi li:hover::after {
  width: 100%;
}

/* 左上から右上に向かって線を出現させる */
.gnavi li:hover::after {
  transition-delay: 0s; /*すぐ線を出現させる*/
}

/* 右下から左下に向かって線を出現させる */
.gnavi li:hover::before {
  transition-delay: 0.3s; /*線の出現を0.3秒遅らせる*/
}

/* 縦の線 */
.gnavi li.current span::before,
.gnavi li.current span::after,
.gnavi li:hover span::before,
.gnavi li:hover span::after {
  height: 100%;
}

/* 左下から左上に向かって線を出現させる */
.gnavi li:hover span::before {
  transition-delay: 0.5s; /*線の出現を0.5秒遅らせる*/
}

/* 右上から右下に向かって線を出現させる */
.gnavi li:hover span::after {
  transition-delay: 0.2s; /*線の出現を0.2秒遅らせる*/
}

/*========= レイアウトのためのCSS ===============*/

.lead {
  padding: 30px 20px;
}

              
            
!

JS

              
                
              
            
!
999px

Console