Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <body id="anchor">
<h1>scroll to top with CSS scroll-behavior</h1>
<main class="container" >
  <p>Lorem Elsass Ipsum mitt picon bière munster du ftomi! Ponchour bisame. Bibbeleskaas jetz rossbolla sech choucroute un schwanz geburtstàg, Chinette dû, ìch bier deppfele schiesser. Flammekueche de knèkes Seppele gal! a hopla geburtstàg, alles fraü Chulia Roberts oder knäckes dûû blottkopf. Noch bredele schissabibala, yeuh e schmutz. E gewurtztraminer doch Carola schneck. </p>
  <p>Lorem Elsass Ipsum mitt picon bière munster du ftomi! Ponchour bisame. Bibbeleskaas jetz rossbolla sech choucroute un schwanz geburtstàg, Chinette dû, ìch bier deppfele schiesser. Flammekueche de knèkes Seppele gal! a hopla geburtstàg, alles fraü Chulia Roberts oder knäckes dûû blottkopf. Noch bredele schissabibala, yeuh e schmutz. E gewurtztraminer doch Carola schneck. </p>
  <p>Lorem Elsass Ipsum mitt picon bière munster du ftomi! Ponchour bisame. Bibbeleskaas jetz rossbolla sech choucroute un schwanz geburtstàg, Chinette dû, ìch bier deppfele schiesser. Flammekueche de knèkes Seppele gal! a hopla geburtstàg, alles fraü Chulia Roberts oder knäckes dûû blottkopf. Noch bredele schissabibala, yeuh e schmutz. E gewurtztraminer doch Carola schneck. </p>
  <p>Lorem Elsass Ipsum mitt picon bière munster du ftomi! Ponchour bisame. Bibbeleskaas jetz rossbolla sech choucroute un schwanz geburtstàg, Chinette dû, ìch bier deppfele schiesser. Flammekueche de knèkes Seppele gal! a hopla geburtstàg, alles fraü Chulia Roberts oder knäckes dûû blottkopf. Noch bredele schissabibala, yeuh e schmutz. E gewurtztraminer doch Carola schneck. </p>
  <p>Lorem Elsass Ipsum mitt picon bière munster du ftomi! Ponchour bisame. Bibbeleskaas jetz rossbolla sech choucroute un schwanz geburtstàg, Chinette dû, ìch bier deppfele schiesser. Flammekueche de knèkes Seppele gal! a hopla geburtstàg, alles fraü Chulia Roberts oder knäckes dûû blottkopf. Noch bredele schissabibala, yeuh e schmutz. E gewurtztraminer doch Carola schneck. </p> 
</main>
  <a class="button-top" href="#anchor" role="button">top</a>
</body>
            
          
!

CSS

            
              
/* button animations */
@keyframes kikaboo {
  to {opacity: 1; z-index: 1}
}
@keyframes thxby {
  from {opacity: 1;}
  50% {transform:  translateX(100%) rotate(.5turn)}
  to {opacity: 1; pointer-events: auto; transform:  translateX(0)}
}
body {
  --delay: 4s;
  --anim-name: kikaboo;
}
body:target {
  --delay: 0;
  --anim-name: thxby;
}

/* scroll behavior on html */
html {
  scroll-behavior: smooth;
}



/* button styling */
.button-top {
  animation: var(--anim-name) 2s forwards;
  animation-delay: var(--delay);
  opacity: 0; 
  z-index: -1;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 5rem;
  height: 5rem;
  background: rgba(0,0,0,.15);
  color: #000;
  text-decoration: none;
  border-radius: 50%;
}
.button-top:hover, .button-top:focus {
  background: rgba(0,0,0,.3);
}




/* Reset */

html {
  font-size: 62.5%;
  box-sizing: border-box;
}
* {
  box-sizing: inherit;
}
body {
  max-width: 40ch;
  margin: auto; 
  padding: 2rem;
	background: #fff;
	font-family: system-ui, Arial, sans-serif;
	font-size: 1.8rem;
  line-height: 1.5;
}

p {
  margin-bottom: 4rem;
}
            
          
!

JS

            
              
            
          
!
999px

Console