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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                <div class="container">

  <div class="section-title">
    <h2>Jedi and thier Lightsabers</h2>
  </div>

  <div class="service-grid">

    <div class="service-item">
      <i class="fab fa-empire"></i>
      <h3 class="red">Darth Vader</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="green">Luke Skywalker</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="blue">Obi-Wan Kenobi</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="green">Yoda</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-empire"></i>
      <h3 class="red">Darth Maul</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="purple">Mace Windu</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="green">Qui-Gon Jinn</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="blue">Anakin Skywalker</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="purple">Mara Jade</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-empire"></i>
      <h3 class="red">Count Dooku</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-rebel"></i>
      <h3 class="blue">Rey</h3>
    </div>
    <div class="service-item">
      <i class="fab fa-empire"></i>
      <h3 class="red">Kylo Ren</h3>
    </div>

  </div>
  <!-- End Service-Grid -->
</div>
              
            
!

CSS

              
                /*----------------------------------------
Mixins and Variables
----------------------------------------*/

$rebel: #ff093c;
$empire: #ff093c;

$red: #ff093c;
$blue: #21bbeb;
$purple: #af4ba4;
$green: #1dc887;

$border: solid 1px #dfdfdf;

@mixin lightsaber($color) {
  background-color: lighten($color, 20%);
  border: solid 3px $color;
  border-radius: 5px;
}

/*----------------------------------------
Base Styles
----------------------------------------*/

html,
body {
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  color: #444;
}

.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 0px;
}

  // @media (min-width: 992px) {
  //   width: 970px;
  // }
  // @media (min-width: 1200px) {
  //   width: 1170px;
  // }

/*----------------------------------------
Grid Layout
----------------------------------------*/


//Base mobile one-column layout
.container {
  width: 750px;
}
.service-item {
  border-top: $border;
  &:first-child {
    border-top: none;
  }
}




.service-item {
  padding: 3rem;
  text-align: center;
  border-top: 1px solid #dfdfdf;
  &:first-child {
    border-top: none;
  }
}

// @media (min-width: 768px) {
//   .service-grid {
//     display: grid;
//     grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
//     grid-gap: 0px;
//   }
//   .service-item {
//     border-top: 1px solid #dfdfdf;
//     border-left: 1px solid #dfdfdf;
//     &:nth-child(-n + 2) {
//       border-top: none;
//     }
//     &:nth-child(odd) {
//       border-left: none;
//     }
//   }
// }

// @media (min-width: 992px) {
//   .service-item {
//     border-top: 1px solid #dfdfdf;
//     border-left: 1px solid #dfdfdf;
//     &:nth-child(-n + 2) {
//       border-top: 1px solid #dfdfdf;
//     }
//     &:nth-child(odd) {
//       border-left: 1px solid #dfdfdf;
//     }
//     &:nth-child(-n + 3) {
//       border-top: none;
//     }
//     &:first-child,
//     &:nth-child(3n + 1) {
//       border-left: none;
//     }
    
    
// Two-column layout
@media (min-width: 768px) {
  .container {
    width: 970px;
  }
  .service-item {
    border-top: $border;
    &:nth-child(even) {
      border-left: $border
    }
    &:first-child,
    &:nth-child(2) {
      border-top: none;
    }
  }
}

//Three-column layout
@media (min-width: 1200px) {
  .container {
    width: 1170px;
  }
  .service-item {
    border-top: 1px solid #dfdfdf;
    &:nth-child(even) {
      border-left: 1px solid #dfdfdf;
    }
    &:first-child,
    &:nth-child(2) {
      border-top: none;
    }
  }
}






.service-item {
  padding: 3rem;
  text-align: center;
  // border-top: 1px solid #dfdfdf;
  // &:first-child {
  //   border-top: none;
  // }
}

@media (min-width: 768px) {
  .service-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(300px, 1fr));
    grid-gap: 0px;
  }

}

@media (min-width: 992px) {
  .service-item {
    border-top: 1px solid #dfdfdf;
    border-left: 1px solid #dfdfdf;
    &:nth-child(-n + 2) {
      border-top: 1px solid #dfdfdf;
    }
    &:nth-child(odd) {
      border-left: 1px solid #dfdfdf;
    }
    &:nth-child(-n + 3) {
      border-top: none;
    }
    &:first-child,
    &:nth-child(3n + 1) {
      border-left: none;
    }
  }
}

/*----------------------------------------
Styles
----------------------------------------*/

.section-title {
  text-align: center;
  font-weight: 100;
  font-size: 150%;
  &:after {
    margin: 12px auto 24px;
    width: 250px;
    height: 5px;
    background-color: #333;
    display: block;
    content: "";
  }
}

.fab {
  font-size: 44px;
  line-height: 70px;
}

h3 {
  font-size: 19px;
  margin-top: 15px;
  margin-bottom: 0;
  font-weight: 700;
  text-transform: uppercase;
  &:after {
    margin: 12px auto 0;
    width: 125px;
    height: 5px;
    background-color: #333;
    display: block;
    content: "";
  }
}

h3.red:after {
  @include lightsaber($red);
}
h3.green:after {
  @include lightsaber($green);
}
h3.purple:after {
  @include lightsaber($purple);
}
h3.blue:after {
  @include lightsaber($blue);
}

              
            
!

JS

              
                
              
            
!
999px

Console