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

              
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
<div id="sec1">
  <h1>Lorem ipsum</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis suscipit consequat elit in auctor. Ut elementum magna sed odio consequat dictum. Curabitur erat odio, sodales non diam sit amet, pretium sagittis sapien. Proin gravida mollis augue nec viverra.
    Morbi id dapibus tellus. Ut posuere lorem sit amet quam feugiat egestas. Phasellus suscipit in nibh non elementum. Aenean ut elementum odio. Nulla facilisi.</p>
</div>
<div id="sec2"><a>Lorem ipsum</a></div>
<div id="sec3">
  <p>Nam gravida tortor in nunc pharetra, ut dignissim sem ultrices. Nulla varius, augue ac consectetur consequat, est magna aliquam arcu, mattis rutrum quam nisl et dui. Vivamus turpis eros, suscipit at euismod a, blandit id nunc. Aliquam ultricies, ligula
    sit amet gravida posuere, eros dui suscipit ligula, vel luctus nisl nisl sit amet dui.</p>
  <p>Nunc vitae mollis ante. Curabitur consectetur fringilla quam, sit amet rhoncus dui ultrices in. Sed interdum enim quis diam pellentesque, a porttitor tortor luctus. Integer interdum finibus bibendum. Donec odio urna, volutpat sed semper quis, semper
    eget mi. Nam vestibulum sagittis elementum. Proin sagittis ligula ac venenatis posuere.</p>
  <p>Etiam faucibus eros hendrerit, viverra ante quis, lacinia erat. Integer lacus nibh, ornare in orci quis, scelerisque sodales justo. Mauris rhoncus neque ut pulvinar tincidunt. Integer odio mi, feugiat sed nisi sed, ornare tempor orci. Maecenas vestibulum
    libero at eros condimentum, sit amet molestie lectus faucibus.</p>
</div>
<div id="sec4"><a>Lorem ipsum</a></div>
              
            
!

CSS

              
                $root-class: 'sec';

$mainColor: lavender;
@import url('https://fonts.googleapis.com/css?family=Abril+Fatface|Alegreya|Indie+Flower|Play|Playfair+Display|Quicksand');
* {
  margin: 0;
  box-sizing: border-box;
  font-family: 'quicksand';
  color: $mainColor;
}

div {
  width: 100%;
  height: 100vh;
  background-repeat: no-repeat;
  background-color: $mainColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

##{$root-class}1 {
  background: linear-gradient(to top, $mainColor, mediumpurple, slateblue);
}

##{$root-class}1 > h1 {
  width: 30%;
  text-align: center;
  border-bottom: 2px solid $mainColor;
}
##{$root-class}1 > p {
  padding: 2em 6em;
  text-align: center;
}

##{$root-class}2 {
  background-image: url('http://www.freeppt.net/background/violet-vector-leaves-circles-backgrounds-for-powerpoint.jpg');
  background-attachment: fixed;
  background-position: 0% 50%;
  //box-shadow: inset 0 0 2000px black;
}

##{$root-class}2 > a {
  text-decoration: none;
  padding: 3%;
  color: $mainColor;
  border: 2px solid $mainColor;
  font-size: 1.5em;
  position: relative;
  transition: all 0.2s linear;
  background-color: fade-out(slateblue, 0.5);
  cursor:pointer;
}

##{$root-class}2 > a:before {
  content: '';
  position: absolute;
  width: 108%;
  height: 134%;
  box-shadow: 0 0 0 2px $mainColor;
  top: -17%;
  left: -4%;
  transition: all 0.2s linear;
}

##{$root-class}2 > a:after {
  content: '';
  position: absolute;
  width: 120%;
  height: 116%;
  box-shadow: 0 0 0 2px $mainColor;
  top: -8%;
  left: -10%;
  transition: all 0.2s linear;
}

##{$root-class}2 > a:hover:after {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
##{$root-class}2 > a:hover:before {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

##{$root-class}3 {
  background: linear-gradient(to bottom, $mainColor, orchid, mediumorchid);
  flex-direction: row;
  justify-content: space-around;
}

##{$root-class}3 > p {
  width: 30%;
  font-size: 1.2em;
  text-align: center;
}

##{$root-class}4 {
  background-image: url('http://wallpapersdsc.net/wp-content/uploads/2016/09/Orchid-4K.jpg');
  background-attachment: fixed;
  background-position: 40% 0%;
  //box-shadow: inset 0 0 2000px black;
}

##{$root-class}4 > a {
  text-decoration: none;
  padding: 3%;
  color: $mainColor;
  border: 2px solid $mainColor;
  font-size: 1.5em;
  position: relative;
  transition: all 0.2s linear;
  background-color: fade-out(mediumorchid, 0.5);
  cursor:pointer;
}

##{$root-class}4 > a:before {
  content: '';
  position: absolute;
  width: 108%;
  height: 134%;
  box-shadow: 0 0 0 2px $mainColor;
  top: -17%;
  left: -4%;
  transition: all 0.2s linear;
}

##{$root-class}4 > a:after {
  content: '';
  position: absolute;
  width: 120%;
  height: 116%;
  box-shadow: 0 0 0 2px $mainColor;
  top: -8%;
  left: -10%;
  transition: all 0.2s linear;
}

##{$root-class}4 > a:hover:after {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
##{$root-class}4 > a:hover:before {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

@media screen and (max-width: 38em) {
  ##{$root-class}1 {
    background: slateblue;
  }

  ##{$root-class}2 > a:after {
    display: none;
  }

  ##{$root-class}2 > a:before {
    display: none;
  }

  ##{$root-class}3 {
    background: mediumorchid;
    flex-direction: column;
  }
  ##{$root-class}3 > p {
    width: 100%;
    font-size: 1em;
  }

  ##{$root-class}4 > a:after {
    display: none;
  }

  ##{$root-class}4 > a:before {
    display: none;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console