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

              
                <div class="container">
  <header id="header">
    <!-- this area is empty, because, since it has the id #header, it gets filled by the sitewide static javascript -->
  </header>
  <div class="main-content">
    <aside id="sidebar">
      <!-- this area is empty, because, since it has the id #sidebar, it gets filled by the sitewide static javascript -->
    </aside>
    <section>
      <!-- this is the area where the main content lives, see? not much else actually in the html body section -->
      <h2>Blue (Da Ba Dee)</h2>
      <blockquote>
        <p>Yo, listen up here&#39;s a story<br />About a little guy<br />That lives in a blue world<br />And all day and all night<br />And everything he sees is just blue<br />Like him inside and outside<br />Blue his house<br />With a blue little window<br />And a blue corvette<br />And everything is blue for him<br />And himself and everybody around<br />Cause he ain&#39;t got nobody to listen to<br />I&#39;m blue<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />I&#39;m blue<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba diI have a blue house<br />With a blue window<br />Blue is the colour of all that I wear<br />Blue are the streets<br />And all the trees are too<br />I have a girlfriend and she is so blue<br />Blue are the people here<br />That walk around<br />Blue like my corvette its in and outside<br />Blue are the words I say<br />And what I think<br />Blue are the feelings<br />That live inside meI&#39;m blue<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />I&#39;m blue<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba diI have a blue house<br />With a blue window<br />Blue is the colour of all that I wear<br />Blue are the streets<br />And all the trees are too<br />I have a girlfriend and she is so blue<br />Blue are the people here<br />That walk around<br />Blue like my corvette, its in and outside<br />Blue are the words I say<br />And what I think<br />Blue are the feelings<br />That live inside me<br />I&#39;m blue<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />I&#39;m blue<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di<br />Da ba dee da ba di</p>
      </blockquote>

    </section>
  </div>
  <footer id="footer">
    <!-- this area is empty, because, since it has the id #header, it gets filled by the sitewide static javascript -->

  </footer>
</div>
</body>

</html>
              
            
!

CSS

              
                /* guess what? nothing here is really important, it's just styling that makes this particular pen look delightfully europop-worthy, i hope. this trick works all on its own, without any CSS whatsoever. try removing all the css. just try it. the content, including all sitewide static content from the javascript, will still appear - it will just look silly and naked */

@import url("https://fonts.googleapis.com/css2?family=Jaro:opsz@6..72&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap");
body {
  font-family: "Source Code Pro", monospace;
  margin: 0;
  padding: 0;
  background-color: #34e3fd;
  text-shadow: 0px 0px 3px #34e3fd;
}

.container {
  display: flex;
  width: 80%;
  border: 5px solid #643cf0;
  margin: 1em auto;
  border-radius: 5rem;
  overflow: hidden;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: linear-gradient(145deg, #347ffd, #643cf0);
  padding: 1rem;
  border-bottom: 5px solid #643cf0;
  text-align: center;
}

header h1 {
  margin: 0;
  font-family: Jaro;
  font-size: 4rem;
  letter-spacing: 0.8rem;
  color: #34fdf5;
  text-shadow: 1px 2px 2px #34e3fd, 0px 7px 5px rgba(0, 0, 0, 0.15),
    0px 12px 1px rgba(0, 0, 0, 0.1), 0px 17px 15px rgba(0, 0, 0, 0.1);
}
aside h2 {
  margin: 0;
  font-family: Jaro;
  font-size: 2rem;
  letter-spacing: 0.4rem;
}

section h2 {
  margin: 0;
  font-family: Jaro;
  font-size: 2rem;
  letter-spacing: 0.4rem;
  color: #5028dc;
  text-shadow: 1px 3px 3px #34e3fd, 0px 7px 5px rgba(0, 0, 0, 0.15),
    0px 12px 1px rgba(0, 0, 0, 0.1), 0px 17px 15px rgba(0, 0, 0, 0.1);
}

nav ul {
  list-style: none;
  padding: 0;
}

nav ul li {
  display: inline;
  margin-right: 10px;
}

nav ul li a {
  text-decoration: none;
  color: #a8d9f7;
  font-weight: bold;
  padding: 0.2rem 0.8rem;
  border-radius: 5px;
  box-shadow: 1px 1px 10px #34e3fd;
  transition: all 1s ease;
}

nav ul li a:hover {
  background-color: #34fdf5;
  color: #5028dc;
}

.main-content {
  display: flex;
  flex: 1;
  background-color: #a8d9f7;
}

aside {
  background: #643cf0;
  color: #a8d9f7;
  padding: 1rem;
  width: 25%;
}

section {
  flex: 1;
  padding: 1rem;
}

footer {
  background: #6666f6;
  text-align: center;
  font-size: 1.2rem;
  background: linear-gradient(145deg, #347ffd, #643cf0);
  color: #a8d9f7;
  border-top: 5px solid #643cf0;
  padding: 0.5rem;
}

              
            
!

JS

              
                //the javascript below would need to go into its own file, and be linked at the bottom of every single page which will contain these sitewide static components. the eurodance-themed example you see here uses three of these, one for the header, one for the sidebar, and one for the footer; however, you can have as many as you need. just copy and paste what's already there and change the values and element ID that you'd like to fill.

const header = // here below is the contents of the header, including both the mock navigation and the <h1> title.
  '<h1>NOW LISTEN UP</h1><nav><ul><li><a href="#">I\'m Blue</a></li><li><a href="#">Da</a></li><li><a href="#">Ba</a></li><li><a href="#">Dee</a></li><li><a href="#">About Me</a></li></ul></nav>';
document.getElementById("header").innerHTML = header;

const sidebar = // here below is the contents of the sidebar, which is just a little blurb about eiffel 65 for demonstration purposes.
  '<h2>Courtesy Eiffel 65...</h2><p>I know almost nothing about Eurodance as a genre. I do, however, know that Eiffel 65\'s seminal hit, "Blue," released on their album "Europop" in 1999 changed the lives of certain middle schoolers forever, myself included. Pouring over the lyrics, seeking secret meanings, giggling and making up our own... riveting stuff...</p>';

document.getElementById("sidebar").innerHTML = sidebar;

const footer = // here below is the contents of the footer, again, mostly just for demonstration. remember - while this particular pen features just these three areas (a header, sidebar, and footer), you can have as many as you need, really)
  "<p>Surely it did have <em>some</em> kind of secret or hidden meaning of some sort, right? Let's be reasonable...</p>";
document.getElementById("footer").innerHTML = footer;

              
            
!
999px

Console