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

              
                <ul>
  <li><a href="https://codepen.io/SJWindahouse/pen/wvJoxgd">FAQ</a></li>
  <li><a href="https://codepen.io/SJWindahouse/pen/rNjgQYV">Why Should I?</a></li>
  <li><a href="#big_button">THE BUTTON!</a></li>
  <li><a href="https://codepen.io/SJWindahouse/pen/zYZrPoK">Motivation</a></li>
  <li><a href="https://codepen.io/SJWindahouse/pen/PopbBWb">Press if done</a></li>
</ul>

<div class="down">
  <h1>The button \/</h1>
</div>
<div id="big_button" class="section-button"> 
<a class="button" href="#popup1">THE BUTTON</a>
</div>

<div id="popup1" class="overlay">
	<div class="popup">
		<h2>Get got.</h2>
		<a class="close" href="#">&times;</a>
		
              
            
!

CSS

              
                ul{
  background-color:white;
  position:fixed;
  padding:30px;
  width:100%;
  z-index:2;
  text-align:center;
}
li{
  display:inline;
  padding:40px;
}
a{
    color:red;
}
h1{
  font-size:50px;
}

section {


}
.down{
  color:pink;
  line-height:400px;
  background-color: black;
   width: 100%;
  text-align:center;
  color:pink;
  cursor:pointer;
 
}
.section-button{
  height:350px;
   position:relative;
  text-align:center;
}
.box {
  width: 40%;
  margin: 0 auto;
  background: rgba(255,255,255,0.2);
  padding: 35px;
  border: 2px solid #fff;
  border-radius: 20px/50px;
  background-clip: padding-box;
  text-align: center;
}

.button {
  font-size: 10em;
  color: white;
  width:80%;
  height:300px;
  background:green;
  position:absolute;
  left:50%;
  line-height:300px;
  margin-left:-40%;
  top:10%;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-out;
}
.button:hover {
  background: #06D85F;
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  transition: opacity 500ms;
  visibility: hidden;
  opacity: 0;
}
.overlay:target {
  visibility: visible;
  opacity: 1;
}

.popup {
  margin: 70px auto;
  padding: 20px;
  background: #fff;
  border-radius: 5px;
  width: 30%;
  position: relative;
  transition: all 5s ease-in-out;
}

.popup h2 {
  margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
}
.popup .close {
  position: absolute;
  top: 20px;
  right: 30px;
  transition: all 200ms;
  font-size: 30px;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}
.popup .close:hover {
  color: #06D85F;
}
.popup .content {
  max-height: 30%;
  overflow: auto;
}

@media screen and (max-width: 700px){
  .box{
    width: 100%;
  }
  .popup{
    width: 100%;
  }
}
              
            
!

JS

              
                // Select all links with hashes
$('a[href*="#"]')
  // Remove links that don't actually link to anything
  .not('[href="#"]')
  .not('[href="#0"]')
  .click(function(event) {
    // On-page links
    if (
      location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 
      && 
      location.hostname == this.hostname
    ) {
      // Figure out element to scroll to
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
      // Does a scroll target exist?
      if (target.length) {
        // Only prevent default if animation is actually gonna happen
        event.preventDefault();
        $('html, body').animate({
          scrollTop: target.offset().top
        }, 1000, function() {
          // Callback after animation
          // Must change focus!
          var $target = $(target);
          $target.focus();
          if ($target.is(":focus")) { // Checking if the target was focused
            return false;
          } else {
            $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
            $target.focus(); // Set focus again
          };
        });
      }
    }
  });
              
            
!
999px

Console