Pen Settings



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


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


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.


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.

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 lang="en">

  <meta charset="UTF-8" />

  <div class="wrapper">
    <!--site header -->
    <section class="site-header">
      <!--company name and desc-->
      <div class="hero-text" id="sticky">
        <h1 >Company name</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing.</p>
    <section class="about">
      <h2>I want to move the company name here</h2>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. At quod dolorum doloremque dicta iste a atque iure explicabo? Laborum, magnam?</p>



                * {
  box-sizing: border-box;
body {

body, h1, .wrapper {
  margin: 0;
  padding: 0;

// site header
.site-header {
  background: grey;
  height: 50vh;
  min-height: 200px;


// company name and desc
.hero-text {
  position: absolute;
  transform:translate(-50%, -50%);
  text-align: center;
  color: white;

.about {
  text-align: center;
.about h2 {
.about p {
  display: block;
  margin: 0 auto;
  max-width: 700px;

.sticky {
  width: 75%;
  position: fixed;
  transform: translate(-50%,0%);


    // Check the initial Poistion of the Sticky Header
    var stickyHeaderTop = $('#sticky').offset().top;
        if( $(window).scrollTop() > stickyHeaderTop ) {
            //$('#sticky').css({position: 'fixed', top: '0px', float: 'right'});
          $('#sticky h1').css("color","rgb(0,0,0)");
        } else {
          var colorPic = Math.round((1-$(window).scrollTop()/stickyHeaderTop)*255);
          $('#sticky h1').css("color","rgb("+colorPic+","+colorPic+","+colorPic+")");