Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <header>
  <a href="#" class="home">🏠</a>
  <nav>
    <ul>
      <li><a href="#">Link 1</a></li>
      <li><a href="#">Link 2</a></li>
      <li><a href="#">Link 3</a></li>
      <li><a href="#">Link 4</a></li>
      <li><a href="#">Link 5</a></li>
    </ul>
  </nav>
</header>
<article>
  <h1>England youngsters reaping rewards of pathway at Under-19 Euros</h1>
  <p>
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Inventore,
    voluptatem incidunt voluptas nobis placeat facilis commodi laboriosam
    similique id veritatis molestias, dignissimos praesentium, autem tenetur
    consequatur beatae itaque. Ipsa, iure.
  </p>
  <img src="https://images.unsplash.com/photo-1553778263-73a83bab9b0c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1000&q=80" class="float-start" alt="generic photo" />
  <p>
    Mollitia delectus sit expedita nobis, nostrum est porro soluta earum
    accusamus! Architecto quae quas aliquid voluptatum rem alias voluptate
    quo quidem, delectus adipisci ipsum sunt maxime officia esse magni
    inventore?
  </p>
  <p>
    Saepe impedit magnam vero sed dolor dicta ipsum. Unde officia nihil
    voluptatum natus velit tempore delectus rerum! Corrupti vero officiis
    temporibus, illo repellat aut, ducimus quis numquam error sunt vitae?
  </p>
  <p>
    Qui rem quas voluptates optio saepe delectus, porro explicabo
    necessitatibus dolorem ratione officiis aperiam perspiciatis numquam
    repellendus doloremque hic assumenda autem iure dolore fuga rerum velit
    quis. Sequi, praesentium inventore.
  </p>
  <img src="https://images.unsplash.com/photo-1589487391730-58f20eb2c308?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1474&q=80" class="float-end" alt="generic photo" />
  <p>
    Qui rem quas voluptates optio saepe delectus, porro explicabo
    necessitatibus dolorem ratione officiis aperiam perspiciatis numquam
    repellendus doloremque hic assumenda autem iure dolore fuga rerum velit
    quis. Sequi, praesentium inventore.
  </p>
</article>
<footer class="no-floats">
  <nav aria-label="Footer navigation">
    <div class="footer-links">
      <ul>
        <li>
          <h2>What we do</h2>
        </li>
        <li><a href="/newsletters/">Newsletters</a></li>
        <li><a href="/community/">Forums</a></li>
      </ul>
      <ul>
        <li>
          <h2>About</h2>
        </li>
        <li><a href="/about-us/">Our story</a></li>
        <li><a href="/legals/">Terms of use</a></li>
        <li><a href="/privacy-policy/">Privacy policy</a></li>
        <li>
          <a href="#">Corporate memberships</a>
        </li>
      </ul>
      <ul>
        <li>
          <h2>Contact</h2>
        </li>
        <li><a href="/contact-us/">Contact us</a></li>
        <li><a href="#">FAQ</a></li>
        <li><a href="/write-for-us/">Write an article for us</a></li>
        <li>
          <a href="#/" target="_blank">Advertise</a>
        </li>
      </ul>
      <ul class="social">
        <li>
          <h2>Connect</h2>
        </li>
        <li>
          <a href="#" rel="noopener noreferrer" target="_blank" aria-label="See facebook account"><svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="facebook-square" class="social-icon fa-facebook-square fa-w-14 fa-lg" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
              <path fill="currentColor" d="M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"></path>
            </svg></a><a href="#" rel="noopener noreferrer" target="_blank" aria-label="See twitter account"><svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="twitter-square" class="social-icon fa-twitter-square fa-w-14 fa-lg" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
              <path fill="currentColor" d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-48.9 158.8c.2 2.8.2 5.7.2 8.5 0 86.7-66 186.6-186.6 186.6-37.2 0-71.7-10.8-100.7-29.4 5.3.6 10.4.8 15.8.8 30.7 0 58.9-10.4 81.4-28-28.8-.6-53-19.5-61.3-45.5 10.1 1.5 19.2 1.5 29.6-1.2-30-6.1-52.5-32.5-52.5-64.4v-.8c8.7 4.9 18.9 7.9 29.6 8.3a65.447 65.447 0 0 1-29.2-54.6c0-12.2 3.2-23.4 8.9-33.1 32.3 39.8 80.8 65.8 135.2 68.6-9.3-44.5 24-80.6 64-80.6 18.9 0 35.9 7.9 47.9 20.7 14.8-2.8 29-8.3 41.6-15.8-4.9 15.2-15.2 28-28.8 36.1 13.2-1.4 26-5.1 37.8-10.2-8.9 13.1-20.1 24.7-32.9 34z"></path>
            </svg></a><a href="#" rel="noopener noreferrer" target="_blank" aria-label="See RSS feed"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="rss-square" class="social-icon fa-rss-square fa-w-14 fa-lg" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
              <path fill="currentColor" d="M400 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM112 416c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm157.533 0h-34.335c-6.011 0-11.051-4.636-11.442-10.634-5.214-80.05-69.243-143.92-149.123-149.123-5.997-.39-10.633-5.431-10.633-11.441v-34.335c0-6.535 5.468-11.777 11.994-11.425 110.546 5.974 198.997 94.536 204.964 204.964.352 6.526-4.89 11.994-11.425 11.994zm103.027 0h-34.334c-6.161 0-11.175-4.882-11.427-11.038-5.598-136.535-115.204-246.161-251.76-251.76C68.882 152.949 64 147.935 64 141.774V107.44c0-6.454 5.338-11.664 11.787-11.432 167.83 6.025 302.21 141.191 308.205 308.205.232 6.449-4.978 11.787-11.432 11.787z"></path>
            </svg></a>
        </li>
      </ul>
    </div>
    <p class="copyright">
      © 2010 –
      <!-- -->2022
      <!-- -->
      Yada Yada Pty. Ltd.
    </p>
  </nav>
</footer>
              
            
!

CSS

              
                article {
  max-width: 900px;
  font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
  margin: 0 auto;
}

.float-start {
  width: 300px;
  float: inline-start;
  margin: 6px;
}

.float-end {
  width: 300px;
  float: inline-end;
  margin: 6px;
}

.no-floats {
  clear: both;
}

footer {
  background-color: black;
  color: white;
  margin: 0;
  font-size: 1.1rem;
}

/* other styles */
body {
  font-family: "Open Sans", sans-serif;
  margin: 0;
  overflow-x: hidden;
}

body > header {
  display: flex;
  align-items: center;
  min-height: 4em;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  font-weight: 700;
  font-size: 1.25rem;
  padding: 0;
  background-color: white;
}

.home {
  padding: 0 2rem 0 0.5rem;
}

nav ul {
  list-style-type: none;
}

nav ul li {
  display: inline-block;
  padding-right: 1rem;
}

nav a {
  text-decoration: none;
  color: inherit;
}

main {
  display: grid;
  max-width: 800px;
  margin: 20px auto;
}

.details {
  display: grid;
  grid-template-columns: auto max-content 1fr;
  align-items: center;
  grid-gap: 10px;
  margin-bottom: 30px;
  width: 100%;
}

h1 {
  font-family: Raleway, serif;
  font-size: 2.25em;
  line-height: 1.25em;
  grid-column: 1 / -1;
}

.author-img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
}

article img {
  display: block;
  width: 100%;
}

a,
a:visited {
  text-decoration: none;
}

footer nav {
  margin: 0 auto;
  max-width: 1248px;
  width: 100%;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-content: space-evenly;
  padding: 16px;
  width: 100%;
}

@media screen and (max-width: 700px) {
  .footer-links {
    grid-template-columns: auto;
  }
}

.footer-links ul {
  display: flex;
  flex-direction: column;
}

.social {
  align-self: flex-start;
}

.social-icon {
  width: 1.5em;
  margin-right: 0.5rem;
}

.copyright {
  text-align: center;
  padding: 5px;
  margin: 0;
}

              
            
!

JS

              
                import dat from "https://cdn.skypack.dev/dat.gui";

const gui = new dat.GUI();

const config = {
  clear: true,
};

gui
  .add(config, "clear")
  .name("Clear footer")
  .onChange(() => {
    const footer = document.querySelector("footer");
    footer.classList.toggle("no-floats");
  });

              
            
!
999px

Console