123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="contained">
  <h2>Grid 2 Columns with background override</h2>
  <div class="gridz gridz-2 gridz-border gridz-bg-light gridz-gap-20 gridz-padding-40">
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it. Some boxes have more copy than others...</p>
    </div>
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
    </div>
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
    </div>
  </div>
  
  <hr />
  
  <h2>Grid 3 Columns with border and gap overide as well as single box color override</h2>
  <div class="gridz gridz-3 gridz-bgg-light gridz-border gridz-gap-10 ">
    
    <div class="gridz-box gridz-bg-blue gridz-border-none gridz-padding-40 text-center ">
<!--       <h2>Grid Box Title</h2> -->
      <p><i class="fa fa-graduation-cap  fa-3x"></i><br />This is some example text with a <a href="#">link to nowhere</a> in it.</p>
      <p class="text-larger">Why don't you check it out!</p>
    </div>
    
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
      <p><a href="#" class="button">Some Button Text</a></p>
    </div>
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it. This box also has more text than the others one do.</p>
      <p><a href="#" class="button">Some Button Text</a></p>
    </div> 
    
    <div class="gridz-box ">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
      <p><a href="#" class="button">Some Button Text</a></p>
    </div>
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it. </p>
      <p><a href="#" class="button">Some Button Text</a></p>
    </div> 
  </div> 
  
  <hr />
   <h2>Grid 2 Columns with border, image and padding overide with inner padding</h2>
  <div class="gridz gridz-2 gridz-padding-0 gridz-border">   
    <div class="gridz-box">
      <img src="https://www.tyndale.ca/sites/default/files/styles/16x9_featured/public/img/articles/2018-06/Students_on_steps_16x9.jpg?itok=AqMJkMCd" alt="" />
      <div class="gridz-inner gridz-padding-10">
        <h2>Grid Box Title</h2>
        <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
        <p class="text-center"><a href="#" class="button">Button Text</a></p>
      </div>
    </div>
    <div class="gridz-box">
      <img src="https://www.tyndale.ca/sites/default/files/styles/16x9_featured/public/img/articles/2018-05/article-international-development.jpg?itok=wajr_NjP" alt="" />
      <div class="gridz-inner gridz-padding-10">
        <h2>Grid Box Title</h2>
        <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
        <p class="text-center"><a href="#" class="button">Button Text</a></p>
      </div>
      
    </div>
<!--     <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text with a <a href="#">link to nowhere</a> in it.</p>
    </div>  -->
    
  </div>
  
  <hr />
   <h2>Grid 4 Columns with border and some box color overrides</h2>
  <div class="gridz gridz-4 gridz-gap-10 gridz-bg-lightt gridz-border">
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button">Button Text</a></p>      
    </div>
    
    <div class="gridz-box gridz-bg-blue">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button-white">Button Text</a></p>
    </div>
  
    <div class="gridz-box gridz-bg-red">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button-white">Button Text</a></p>
    </div>

    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button">Button Text</a></p>
    </div>

    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button">Button Text</a></p> 
    </div>

    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button">Button Text</a></p>      
    </div>
    
    <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button">Button Text</a></p>      
    </div>
    
<!--     <div class="gridz-box">
      <h2>Grid Box Title</h2>
      <p>This is some example text.</p>
      <p><a href="#" class="button">Button Text</a></p>
    </div> -->
    
  </div>
  
</div>
            
          
!
            
              // colors
$blue: #215;
$red: #b22;
$gold: #ea0;
$green: #790;
$dark: #222;
$light: #efefef;
$white: #fff;

*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  padding: 0;
  margin:0;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, “Segoe UI”, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5em;
  color: $dark;
  background: $light;
}

img {
  max-width:100%;
  height: auto;
}

p { margin:0 0 20px 0; }

// contained
.contained {
  margin: 40px auto;
  max-width: 700px;
  background: $white;
  padding: 20px;
}

// GRIDZ

.gridz {
//   flex
  display: flex;
  flex-wrap: wrap;
  margin:0 0 20px;
  
//   grid
  display: grid;
  grid-gap: 20px;
  margin: 0 auto 20px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));  
}

.gridz.gridz-3 { 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
}

.gridz.gridz-4 { 
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
}

.gridz.gridz-gap-0 { grid-gap: 0px; }
.gridz.gridz-gap-5 { grid-gap: 5px; }
.gridz.gridz-gap-10 { grid-gap: 10px; }
.gridz.gridz-gap-15 { grid-gap: 15px; }




.gridz-box {
//   flex
  margin: 5px;
  flex: 1 1 200px;

  //   all  
  padding:20px;
}

.gridz-2 .gridz-box { flex: 1 1 250px; }

.gridz-4 .gridz-box {
  flex: 1 1 140px;
}

.gridz-box h2 {
  font-weight: 400;
  margin: 0 0 10px;
  font-size: 1.4em;
  color: $blue;
}

/* We need to set the margin used on flex items to 0 as we have gaps in grid.  */

@supports (display: grid) {
  .gridz-box {
    margin: 0;
  }
}

// padding for grids - default 20px

.gridz.gridz-padding-0 .gridz-box,
.gridz-padding-0.gridz-box,
.gridz-inner.gridz-padding-0 {padding: 0px; }

.gridz.gridz-padding-5 .gridz-box,
.gridz-padding-5.gridz-box,
.gridz-inner.gridz-padding-5 { padding: 5px; }

.gridz.gridz-padding-10 .gridz-box,
.gridz-padding-10.gridz-box,
.gridz-inner.gridz-padding-10 { padding: 10px; }

.gridz.gridz-padding-20 .gridz-box,
.gridz-padding-20.gridz-box,
.gridz-inner.gridz-padding-20 { padding: 20px; }

.gridz.gridz-padding-40 .gridz-box,
.gridz-padding-40.gridz-box,
.gridz-inner.gridz-padding-40 { padding: 40px; }

// color and border options

// border
.gridz-border .gridz-box,
.gridz-box.gridz-border {
  border:1px solid #ddd;
}

// light box
.gridz-bg-light .gridz-box,
.gridz-box.gridz-bg-light{
  background-color: $light;
  color:#222;
}

.gridz-bg-light.gridz-border .gridz-box,
.gridz-bg-light.gridz-border.gridz-box{
  border:1px solid #ddd;
}

// dark box

.gridz-bg-dark.gridz-box {
  background-color: $dark;
  color:#fff;
  
  & a {color: $gold; text-decoration:underline;}
  & a:visited {color: $gold; text-decoration:underline;}
  & a:hover {color: lighten( $gold, 20% ); text-decoration:underline;}
  & a:active {color: lighten( $gold, 20% ); text-decoration:underline;}
  
  & h2 { color: $white; }
}

.gridz-bg-dark.gridz-border .gridz-box,
.gridz-bg-dark.gridz-border.gridz-box,
.gridz-border .gridz-bg-dark.gridz-box {
  border:1px solid $dark;
}

// blue box

.gridz-bg-blue.gridz-box {
  background: linear-gradient(to right, #221155 0%,#1e1c8e 100%);
  color:$white;
  
  & a {color: $gold; text-decoration:underline;}
  & a:visited {color: $gold; text-decoration:underline;}
  & a:hover {color: lighten( $gold, 20% ); text-decoration:underline;}
  & a:active {color: lighten( $gold, 20% ); text-decoration:underline;}
  
  & h2 { color: $white; }
}

.gridz-bg-blue.gridz-border .gridz-box,
.gridz-bg-blue.gridz-border.gridz-box,
.gridz-border .gridz-bg-blue.gridz-box {
  border: 1px solid $blue;
}

// red box

.gridz-bg-red.gridz-box {
  background: linear-gradient(to right, #b22 0%,#e22 100%);
  color:$white;
  
  & a {color: $light; text-decoration:underline;}
  & a:visited {color: $light; text-decoration:underline;}
  & a:hover {color: $white; text-decoration:underline;}
  & a:active {color: $white; text-decoration:underline;}
  
  & h2 { color: $white; }
}

.gridz-bg-red.gridz-border .gridz-box,
.gridz-bg-red.gridz-border.gridz-box,
.gridz-border .gridz-bg-red.gridz-box {
  border: 1px solid $red;
}


.gridz-box.gridz-border-none,
.gridz-bg-light.gridz-box.gridz-border-none,
.gridz-bg-dark.gridz-box.gridz-border-none,
.gridz-bg-blue.gridz-box.gridz-border-none,
.gridz-bg-red.gridz-box.gridz-border-none
{ border: none; }


.gridz-box.gridz-shadow, 
.gridz-shadow .gridz-box { 
  box-shadow: 0px 0px 6px 2px rgba(0,0,0,0.2); 
}

// utilities
.text-center { text-align: center; }

a.button, a:visited.button {
  text-align: center;
  display:inline-block;
  background-color: $blue;
  color: $white;
  font-size: 0.9em;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none !important; 
}  
a:hover.button { background-color: lighten($blue, 10%);  }

a.button-white, a:visited.button-white {
  text-align: center;
  display:inline-block;
  background-color: $white;
  color: $dark !important;
  font-size: 0.9em;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none !important; 
}  
a:hover.button-white { background-color: $light;  }

.text-larger { font-size: 1.1em;}

hr { margin:40px auto; max-width: 50%; }
  
 
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console