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

              
                <article class="athelas">
  <div class="vh-50 dt w-100 tc bg-dark-gray white cover o-60" style="background:url(https://s3.amazonaws.com/blog.invisionapp.com/uploads/2016/10/type-hero.png?ver=1) no-repeat center;">
    <div class="dtc v-mid">
      <header class="white-70">
        <h2 class="f6 fw1 ttu tracked mb2 lh-title">Categories: Web design</h2>
      </header>
      <h1 class="f1 f-headline-l fw1 i blue">Flash of unstyled content</h1>
      <blockquote class="ph0 mh0 measure f4 lh-copy center">
        <p class="fw1 white">From Wikipedia, the free encyclopedia 
        </p>
      </blockquote>
    </div>
  </div>
  <div class="center measure-wide f5 pv5 lh-copy ph2">
        

    <p>A <b>flash of unstyled content</b> (<b>FOUC</b>, also <b>flash of unstyled text</b> or <b>FOUT</b>)
  is an instance where a <a href="https://en.wikipedia.org/wiki/Web_page" title="Web page">web page</a> appears briefly with the browser's default styles prior to loading an external <a href="https://en.wikipedia.org/wiki/CSS_stylesheet" class="mw-redirect" title="CSS stylesheet">CSS stylesheet</a>, due to the <a href="https://en.wikipedia.org/wiki/Web_browser_engine" title="Web browser engine">web browser engine</a> rendering the page before all information is retrieved. The page corrects itself as soon as the style rules are loaded and applied; however, the shift may be distracting. Related problems include <b>flash of invisible text</b> (FOIT) and <b>flash of faux text</b> (FOFT).
    
  </p>
<h2><span class="mw-headline" id="Technical_information">Technical information</span></h2>
<p>The issue was documented in an article named "Flash of Unstyled Content". At first, FOUC appeared to be a browser problem unique to <a href="https://en.wikipedia.org/wiki/Internet_Explorer" title="Internet Explorer">Internet Explorer</a> but later became apparent in other browsers and has since been described as "a <a href="https://en.wikipedia.org/wiki/Safari_(web_browser)" title="Safari (web browser)">Safari</a> epidemic".</p>
<p>FOUC is indifferent to changes in <a href="https://en.wikipedia.org/wiki/CSS" class="mw-redirect" title="CSS">CSS</a> or <a href="https://en.wikipedia.org/wiki/HTML" title="HTML">HTML</a> versions. The problem originates from a set of priorities programmed into the browser. As the browser collects HTML and all the ancillary files referenced in the markup, the browser builds the <a href="https://en.wikipedia.org/wiki/Document_Object_Model" title="Document Object Model">Document Object Model</a> on-the-fly. The browser may choose to first display the text, which it can parse the quickest.</p>
<p>FOUC is more prevalent now that HTML pages are more apt to reference multiple style sheets. Web pages often include style references to media other than the browser screen, such as CSS rules for printers and mobile devices. Web pages may import layers of style files, and reference alternative style sheets. Online advertisements and other inserted offsite content, like videos and search engines, often dictate their own style rules within their code block. The cascading nature of CSS rules encourages some browsers to wait until all the style data is collected before applying it.</p>
<p>With the advent of <a href="https://en.wikipedia.org/wiki/JavaScript_library" title="JavaScript library">JavaScript libraries</a> such as <a href="https://en.wikipedia.org/wiki/JQuery" title="JQuery">jQuery</a> that can be employed to further define and apply the styling of a web page, FOUC has also become more prominent. In an attempt to avoid unstyled content, front-end developers may choose to hide all content until it is fully loaded, at which point a load event handler is triggered and the content appears.</p>
<p>To emulate an FOUC, developers can use browser add-ons that are capable of disabling a web page's CSS on-the-fly. <a href="https://en.wikipedia.org/wiki/Firebug_(software)" title="Firebug (software)">Firebug</a> is one such add-on.</p>
<p>While, by 2016, several different techniques had been developed to avoid undesired display behaviours, a change in rendering behaviour in <a href="https://en.wikipedia.org/wiki/Google_Chrome" title="Google Chrome">Google Chrome</a> version 50, whereby stylesheets injected by JavaScript are prevented from blocking page loading, as required by the <a href="https://en.wikipedia.org/wiki/HTML5" title="HTML5">HTML5</a> specification, brought the situation to website creators' attentions again, particularly affecting users of <a href="https://en.wikipedia.org/wiki/Typekit" title="Typekit">Typekit</a>, a <a href="https://en.wikipedia.org/wiki/Web_typography" title="Web typography">web typography</a> product from <a href="https://en.wikipedia.org/wiki/Adobe_Systems" title="Adobe Systems">Adobe Systems</a>. Within 2 months, Adobe had changed the way in which their fonts were included into third-party websites in order to avoid the undesired rendering behaviour.</p>
  </div>
</article>
              
            
!

CSS

              
                .cover.styled {
  background-size: cover !important;
}

.dt.styled {
  display: table;
}

.dtc.styled {
  display: table-cell;
}

.athelas.styled {
  font-family: athelas, georgia, serif;
}

.i.styled {
  font-style: italic;
}

.fs-normal.styled {
  font-style: normal;
}

.fw1.styled {
  font-weight: 100;
}

.vh-50.styled {
  height: 50vh;
}

.tracked.styled {
  letter-spacing: .1em;
}

.lh-title.styled {
  line-height: 1.25;
}

.lh-copy.styled {
  line-height: 1.5;
}

.w-100.styled {
  width: 100%;
}

.white-70.styled {
  color: rgba(255, 255, 255, .7);
}

.white-60.styled {
  color: rgba(255, 255, 255, .6);
}

.white.styled {
  color: #fff;
}

.bg-dark-gray.styled {
  background-color: #333;
}

.pv5.styled {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.ph0.styled {
  padding-left: 0;
  padding-right: 0;
}

.ph2.styled {
  padding-left: .5rem;
  padding-right: .5rem;
}

.mb2.styled {
  margin-bottom: .5rem;
}

.mh0.styled {
  margin-left: 0;
  margin-right: 0;
}

.tc.styled {
  text-align: center;
}

.ttu.styled {
  text-transform: uppercase;
}

.f1.styled {
  font-size: 2rem;
}

.f4.styled {
  font-size: 1.25rem;
}

.f5.styled {
  font-size: 1rem;
}

.f6.styled {
  font-size: .875rem;
}

.measure.styled {
  max-width: 30em;
}

.measure-wide.styled {
  max-width: 34em;
}

.center.styled {
  margin-right: auto;
  margin-left: auto;
}

.v-mid.styled {
  vertical-align: middle;
}
.fw9.styled {
  font-weight: 400;
}

.pa4.styled {
  padding: 2rem;
}

.measure-narrow.styled {
  max-width: 20em;
}

@media screen and (min-width: 30em) {
  .lh-title-ns.styled {
    line-height: 1.25;
  }

  .f1-ns.styled {
    font-size: 2rem;
  }

  .f4-ns.styled {
    font-size: 1.25rem;
  }
}

@media screen and (min-width: 60em) {
  .f-headline-l.styled {
    font-size: 4rem;
  }
}

              
            
!

JS

              
                const nodeList = document.querySelectorAll("*");
const nodeListToArray = Array.apply(null, nodeList);

const maxLoops = nodeListToArray.length;
let counter = 0;

function style() {
  while (counter++ < maxLoops) {
    nodeListToArray[counter].classList.add("styled");
  }
}

setTimeout(function() {
  style();
}, 2000);

              
            
!
999px

Console