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

              
                <p>スクロール↓</p>

<input type="checkbox" id="close"><!--チェックボックス-->  
<div class="float-btn"> <!--追従ボタン-->
  <p>ここに煽り(マイクロコピー)</p>
  <a href="#">ここにボタン</a>
  <label for="close" class="fb-close">×</label> <!-- 閉じるボタン -->
</div>
              
            
!

CSS

              
                /*** 追従パーツの全体 ***/
.float-btn{
  position: fixed; /*画面固定*/
  bottom: 0; /*下*/
  left: 0;
  width: 100%; /*フルワイド*/
  background: rgba(0,0,0,50%); /*半透明の黒*/
  padding: 16px 0;
  display: flex; /*中身をフレックス表示*/
  justify-content: center; /*中央寄せ*/
  align-items: center; /*縦軸中央寄せ*/
}

/*** マイクロコピー ***/
.float-btn > p{
  color: #fff;
  margin: 0 1rem;
}
/* スマホ向け */
@media screen and (max-width: 520px){
  .float-btn p{
    display: none; /*非表示*/
  }
}

/*** ボタン部分 ***/
.float-btn > a{
  display: inline-block;
  vertical-align: middle; /*上下中央寄せ*/
  line-height: 1.5;
  padding: 5px 30px;
  border-radius: 4px;
  background: #F37167;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 0 #96150C;
  transition: .3s;
}
/*ボタンホバー時*/
.float-btn a:hover{
  transform: translateY(2px); /*押下*/
  box-shadow: none;
}

/*** 閉じるボタン ***/
.fb-close{
  position: absolute;
  top: 0;
  right: 20px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/*** ×をクリック(チェックボックスに✔) ***/
#close:checked ~ .float-btn{
  display: none; /*バナー削除*/
}

/*** チェックボックスは非表示に ***/
#close{
  display: none;
}

/*** サンプル装飾用 ***/
body{
  padding-bottom: 400vh;
  zoom: 0.9;
}
body > p{
  text-align: center;
  font-size: 26px;
}
              
            
!

JS

              
                
              
            
!
999px

Console