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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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="container">

  <header>
    <nav>
      <h2>Untitled</h2>
      <ul>
        <li>
          <a href="#" title="About">About</a>
        </li>
        <li>
          <a href="#" title="Resume">Resume</a>
        </li>
        <li>
          <a href="#" title="Contact">Contact</a>
        </li>
      </ul>
    </nav>
  </header>

  <section class="main">
    <h1>I'm a creative web developer, who specializes in building beautiful websites</h1>
  </section>

  <section class="gallery">
    <ul>
      <li class="item">
        <div class="info">
          <a href="#" title="Project Title">
            <img src="https://source.unsplash.com/hnEtVqVlVZU">
          </a>
          <h3>Project Title</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </li>
      <li class="item">
        <div class="info">
          <a href="#" title="Project Title">
            <img src="https://source.unsplash.com/RPzWI0rolS8">
          </a>
          <h3>Project Title</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </li>
      <li class="item">
        <div class="info">
          <a href="#" title="Project Title">
            <img src="https://source.unsplash.com/i1S4n4yQUKM">
          </a>
          <h3>Project Title</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </li>
      <li class="item">
        <div class="info">
          <a href="#" title="Project Title">
            <img src="https://source.unsplash.com/QgHvLSuIcLs">
          </a>
          <h3>Project Title</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </li>
      <li class="item">
        <div class="info">
          <a href="#" title="Project Title">
            <img src="https://source.unsplash.com/s74-lwoDFOw">
          </a>
          <h3>Project Title</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </li>
      <li class="item">
        <div class="info">
          <a href="#" title="Project Title">
            <img src="https://source.unsplash.com/KTTG3Jcrfz4">
          </a>
          <h3>Project Title</h3>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </li>
    </ul>
  </section>

  <footer>
    <p>
      &copy; Copyright 2017 <a href="http://katherinekato.com" title="Katherine Kato" target="_blank">Katherine Kato</a>
    </p>
  </footer>

</div>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Roboto:400,500');

*, *:before, *:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  background: #fff;
  color: #999;
  line-height: 1.5;
}

.container {
  max-width: 980px;
  margin: 0 auto;
}

a {
  color: #33bfd0;
  text-decoration: none;
  -webkit-transition: color 0.3s ease-out;
  -o-transition: color 0.3s ease-out;
  transition: color 0.3s ease-out;
}

a:hover {
  color: #70d2de;
}

img {
  display: block;
  vertical-align: middle;
  width: 100%;
  -webkit-transition: opacity 0.3s ease-out;
  -o-transition: opacity 0.3s ease-out;
  transition: opacity 0.3s ease-out;
}

img:hover {
  opacity: 0.75;
}

a, img {
  border: none;
  outline: none;
}

.main {
  padding: 5em 0;
  width: 80%;
  margin: 0 auto;
}

h1, h2, h3 {
  color: #333;
}

h1 {
  font-size: 2em;
  text-align: center;
  font-weight: 500;
}

h3 {
  font-size: 1.3em;
  margin: 2rem 0 0 0;
  line-height: 0.5;
  font-weight: 500;
}

header {
  text-align: center;
  color: #33bfd0;
  text-transform: uppercase;
}

header nav {
  list-style-type: none;
  font-family: 'Montserrat', sans-serif;
}

header nav li {
  margin: 0 15px;
  display: inline-block;
}

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

.gallery ul li {
  padding-bottom: 1em;
}

.item {
  max-width: 50%;
  float: left;
  margin-bottom: 1em;
  display: block;
}

.item:nth-of-type(2n+1) {
  clear: left;
}

footer {
  text-align: center;
  padding: 2em 0;
}

/* CSS Grid */
.container {
  display: grid;
  grid-template-columns: 3fr 4fr;
  grid-template-areas:
    "header header header"
    "main main main"
    "gallery gallery gallery"
    "footer footer footer";
}

.main {
  grid-area: main;
}

header {
  grid-area: header;
  display: grid;
  justify-items: center;
}

.gallery {
  grid-area: gallery;
}

.gallery ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  grid-gap: 1em;
}

footer {
  grid-area: footer;
  display: grid;
  justify-items: center;
}

/* Flexbox */
header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

header nav {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

header nav ul {
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
}

.gallery ul {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.gallery ul li {
  -webkit-box-flex: 0;
  -ms-flex: 0 1 calc(50% - 1em);
  flex: 0 1 calc(50% - 1em);
  -ms-flex-preferred-size: calc(50% - 1em);
  flex-basis: calc(50% - 1em);
}

footer {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

/* Media Queries */
@media (max-width: 824px) {
  header nav li {
    margin: 0 10px;
  }

  .gallery ul {
    grid-template-columns: 100%;
  }

  .gallery ul li {
    -ms-flex-preferred-size: 100%;
    flex-basis: 100%;
  }

  .item {
    max-width: 100%;
    float: none;
  }
}
            
          
!
999px
Loading ..................

Console