cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

              <div class="header">
  <h1 class="header_logo">Resizing Fixed Header</h1>
<div class="offset">
  <p>Scroll down to initiate resizing of the page header.</p>
              body {
  height: 1500px;
  background: url(https://www.brainpickings.org/wp-content/themes/brainpickings/images/bckgd_body.png);

.offset {
  margin-top: 0;
  padding-top: 270px;
  text-align: center;
  transition: .3s;

.header {
  position: fixed;
  width: 100%;
  height: 250px;
  font-weight: bold;
  text-align: center;
  background: gold;
  transition: .3s;
  // header shrinks when .small added to .header
  &.small {
    height: 70px;
    box-shadow: 0 0 5px rgba(black, .2);
    // when header.small also change page offset
    & ~ .offset {
      padding-top: 140px;
    // when header.small change logo pad & font size
    .header_logo {
      padding-top: 20px;
      font-size: 20px;
      text-shadow: none;

.header_logo {
  font-family: 'Oswald', sans-serif;
  margin: 0;
  padding-top: 80px;
  font-size: 50px;
  text-shadow: 3px 4px rgba(black, .1);
  transition: .3s;
              $(document).scroll(function() {

function navbarScroll() {
  var y = window.scrollY;
  if (y > 10) {
  } else if (y < 10) {
Loading ..................