css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              <div class="page">
  <header>
    <div class="logo">
      <span>LOGO</span>
    </div>
    <nav class="nav">
      <ul class="items">
        <li>website.de</li>
      </ul>
    </nav>
    <button class="button">click me</button>
  </header>
  <main>
    <section class="section">
      <div class="hero"></div>
    </section>
    <section class="section scroll">
      <div class="scroll__left">
        <h1>Super Exclusive Job Title – Supervisor Chief Officer</h1>
        <h4>Oh look a headline</h4>
        <p>
          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
        </p>
        <ul>
          <li>Item 1</li>
          <li>Item 2</li>
          <li>Item 3</li>
          <li>Item 4</li>
          <li>Item 5 is a item that is large enough to wrap to another line of text. Mayber it's even large enough to wrap around earth – I don't know.</li>
          <li>Item 6</li>
          <li>Item 7</li>
          <li>Item 8</li>
        </ul>
        <h4>This is a headline too</h4>
        <ul>
          <li>Item 1</li>
          <li>Item 2</li>
          <li>Item 3</li>
          <li>Item 4</li>
          <li>Item 5 is a item that is large enough to wrap to another line of text. Mayber it's even large enough to wrap around earth – I don't know.</li>
          <li>Item 6</li>
          <li>Item 7</li>
          <li>Item 8</li>
        </ul>
        <p>
          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
        </p>
        <p>
          Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,
        </p>
        <p>
          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   
        </p>
        <p>
          Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet,
        </p>
      </div>
      <div class="scroll__right">
        <div class="sticky border">
          <div class="miniheadline">
            <span>Headline</span>
            <span>Content</span>
          </div>
          <div class="miniheadline">
            <span>Headline</span>
            <span>Content</span>
          </div>
          <p class="small">
            Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
          </p>
          <p class="small">
            Lorem ipsum dolor sit amet, <strong>consetetur sadipscing elitr</strong>, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et
          </p>
          <hr>
          <p class="small">
            Lorem ipsum dolor sit amet, <strong>consetetur sadipscing elitr</strong>, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et
          </p>
          <img class="res" src="https://images.unsplash.com/photo-1504593811423-6dd665756598?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=9305a37dfc018487bca76a6f59944ad4&auto=format&fit=crop&w=750&q=80" />
        </div>
      </div>
    </section>
  </main>
  <footer></footer>
</div>
            
          
!
            
              $i_hands: 'https://images.unsplash.com/photo-1519120126473-8be7aedcd6c6?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a55332dfc236b13f118ef77a36b4052f&auto=format&fit=crop&w=1500&q=80';

$i_person: 'https://images.unsplash.com/photo-1504593811423-6dd665756598?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=9305a37dfc018487bca76a6f59944ad4&auto=format&fit=crop&w=750&q=80';

@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i');

$pink: #dd3662;
$rose: #fdbfcf;
$text: #3c3c3c;
$white: #ffffff;
$lightgrey: #ececec;

*,*:before,*:after {
  box-sizing: border-box;
}

html, body {
  font-family: 'Roboto Condensed', sans-serif;
  margin: 0;
  padding: 0;
  color: $text;
}

p,ul,h1,h4 {
  margin: 0;
}

main {
  p,ul,h1,h4,img,div {
    opacity: 0;
    transform: translate3d(0,200px,0);
    transition: transform 500ms ease, opacity 500ms ease;
  }
}

body {
  font-size: 1.125em; //18px
  line-height: 1.556em; //28px
  &.ready {
    main {
      p,ul,h1,h4,img,div {
        opacity: 1;
        transform: translate3d(0,0,0);
      }
    }
  }
}

hr {
  width: 100%;
  height: 1px;
  border: none;
  background-color: $lightgrey;
}

h1 {
  font-size: 3.556em; //64px
  line-height: 1.313em; //84px
  padding: 0;
  margin: 0 0 50px 0;
}

h4 {
  font-size: 1.667em; //30px
  line-height: 1.400em; //42px;
  padding: 0;
  margin: 0 0 20px 0;
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 0 0 20px 0;
}

p {
  margin: 0 0 20px 0;
  &.small {
    font-size: 0.778em; //14px
    line-height: 1.714em; //24px
  }
}

button {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 1.000em;
  font-weight: 700;
  min-width: 180px;
  max-height: 50px;
  width: auto;
  height: 50px;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  color: $white;
  cursor: pointer;
  border-radius: 30px;
  background-color: $pink;
  box-shadow: 0 0 15px 0 $rose;
  transition: box-shadow 500ms ease;
  &:hover {
    box-shadow: 0 0 15px 0 $pink;
  }
}

.res {
  max-width: 100%;
  height: auto;
}

.sticky {
  top: 100px;
  position: sticky;
}

.page {
  width: 1110px;
  height: auto;
  margin: 0 auto;
}

header {
  position: fixed;
  max-width: 1110px;
  width: 100%;
  height: 150px;
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  transition: height 500ms ease;
  .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 55px;
    color: $text;
    border: 2px solid $text;
  }
  .nav {
    display: flex;
    flex-grow: 1;
    justify-content: flex-end;
    padding: 0 30px;
    ul {
      margin: 0;
    }
  }
  &.scrolly {
    height: 100px;
    background-color: rgba(255,255,255,0.85);
  }
}

main {
  margin: 150px 0 0 0;
  .section {
    ul {
      list-style-type: disc;
      padding: 0 0 0 20px;
      max-width: 75%;
    }
  }
  .hero {
    width: 100%;
    height: 325px;
    margin: 0 0 65px 0;
    background-image: url($i_hands);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
  }
  .scroll {
    display: flex;
    align-items: stretch;
    &__left {
      width: 72%;
      padding: 0 45px 0 0;
    }
    &__right {
      width: 28%;
      .border {
        padding: 0 0 0 45px;
        border-left: 1px solid $lightgrey;
      }
      .miniheadline {
        display: flex;
        justify-content: space-between;
        span {
          &:first-child {
            font-weight: 700;
          }
        }
        &:nth-child(2) {
          margin: 0 0 20px 0;
        }
      }
    }
  }
}
            
          
!
            
              window.addEventListener('scroll',function() {
  let header = document.querySelectorAll('header')[0];
  let current = document.documentElement.scrollTop;
  console.log(current);
  if(current > 10) {
    if(!header.classList.contains('scrolly')) {
      header.classList.add('scrolly');
    }
  } else {
    header.classList.remove('scrolly');
  }
});
window.addEventListener('load',function() {
  let body = document.querySelectorAll('body')[0];
  body.classList.add('ready');
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console