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

              
                <header>
  <nav>
    <ul role="list">
      <li><a href="#">Home</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
  </nav>
</header>
<main>
  <h1>A Demo Site showcasing CSS Grid</h1>
  <p>CSS Grid Demo Site - Unleash Your Creativity! Explore the power of CSS Grid on our simulated landing page.</p>
  <p>Experience simplified layouts, intuitive design structures, and get inspired for your own projects. Discover the wonders of CSS Grid today!</p>
  <h2>Some articles</h2>
  <p>This article list will adapt to the container's space with <strong>no media queries involved!</strong></p>
  <ul role="list">
    <li>
      <article>
        <h3>Article 1</h3>
        <p>A brief article about CSS Grid</p>
      </article>
    </li>
    <li>
      <article>
        <h3>Article 2</h3>
        <p>Another brief article</p>
      </article>
    </li>
    <li>
      <article>
        <h3>Article 3</h3>
        <p>A brief article about CSS Grid</p>
      </article>
    </li>
     <li>
      <article>
        <h3>Article 4</h3>
        <p>Another brief article</p>
      </article>
    </li>
    <li>
      <article>
        <h3>Article 5</h3>
        <p>A brief article about CSS Grid</p>
      </article>
    </li>
  </ul>
</main>
<aside class="sidebar img">
  <h2>Find Me on Social Media</h2>
  <p><a href="https://twitter.com/charliecodes">Twitter</a></p>
  <p><a href="https://www.linkedin.com/in/charleseteure/">LinkedIn</a></p>
</aside>
<section class="about">
  <h2>About </h2>
  <p>We are passionate about showcasing the incredible capabilities of CSS Grid, a cutting-edge web layout tool. Through this simulated platform, we invite you to explore simplified layouts, intuitive design structures, and unleash your creativity.</p>
</section>
<section class="contact">
  <h2>Contact</h2>
  <p>We would love to hear from you! If you have any questions, feedback, or inquiries, please feel free to reach out to us. Contact me via social media. I'm here to assist you and provide any additional information you may need. Thank you for visiting our CSS Grid Demo Site, and we look forward to connecting with you soon!</p>
</section>
<footer>
  <p>Built with <3 by <a href="https://twitter.com/charliecodes">Charles Freeborn</a></p>
<p>Forked by <strong>Cristian Díaz</strong>. All credits go to Charles Freeborn, please check <a href="https://codepen.io/freeborncharles/full/ZEpVLzR">the original Codepen</a> </p>

</footer>
              
            
!

CSS

              
                body{
  background: #F1F0EE;
  margin: 0;
  display: grid;
  min-height: 100vh;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "nav nav nav nav"
    "main main main sidebar"
    "about about about sidebar"
    "contact contact contact sidebar"
    "footer footer footer footer";
  gap: 0.5rem;
  color: #004d40;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

ul[role="list"] {
  list-style: none;
  padding: 0;
}

header {
  background-color: #3770F6;
  grid-area: nav;
}

header ul{
  font-weight: bolder;
}

nav li{
  display: inline-block;
}

li a{
  color: #ffffff;
}

a:hover{
  color: #FF7F50;
}

main {
  grid-area: main;
}

main h2 {
  font-weight: bolder;
}

main p{
text-align: left;
}

main ul {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
}

article {
  border: 1px solid currentColor;
  padding: 0.5rem;
}

.sidebar {
  background: #D3D4D7;
  grid-area: sidebar;
}

.about {
  background: #D7D6D3;
  grid-area: about;
}

.contact {
  background: #BDBCBB;
  grid-area: contact;
}


footer {
  padding-block: 1rem;
  background-color: #3770F6;
  grid-area: footer;
  color: #ffffff;
  text-align: center;
}

footer a {
  display: inline;
  margin: 0;
  color: #ffffff;
}

a {
  text-align: center;
  display: block;
  font-family: inherit;
  font-weight: bold;
  margin: 1rem;
}

@media only screen and (max-width: 550px) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "sidebar"
      "main"
      "about"
      "contact"
      "footer";
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console