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

              
                <header>
  <input type="checkbox" name="" value="" id="vertical-grid">
  <label for="vertical-grid"> View grid </label>
  <div class="vertical-grid"></div>
</header>

<div class="wrapper"">
                     <aside class="sidebar">
                                           <a href="#"> Sidebar Link </a>
                                                      <a href="#"> Another Sidebar Link </a>
                                                                 <a href="#"> Link in the Sidebar </a>
                                                                            </aside>

                                                                            <main>
                                                                            <h1> Vertical Grid: </h1>
                                                                            <h2> An introductory sandbox to test out your grid </h2>

                                                                            <p class="intro">
                                                                                            This is me; playing with how to create a vertical grid and maintain it.
                                                                                            </p>

                                                                                            <div class="columns columns--2">
                                                                                                                           <div>
                                                                                                                           <h3> Typography </h3>
                                                                                                                           <h4> Headers and body text </h4>
                                                                                                                           <p>
                                                                                                                           Wash. You gotta be kitten me right meow What a cat-ass-trophy! soft kitty
                                                                                                                           warm kitty little ball of furr sniff sniff, yet lick left leg for
                                                                                                                           ninety minutes, still dirty.
                                                                                                                           </p>

                                                                                                                           <p>
                                                                                                                           Tickle my belly at your own peril i will pester for food when you're in
                                                                                                                           the kitchen even if it's salad cats making all the muffins and instantly
                                                                                                                           break out into full speed gallop across the house for no reason sniff
                                                                                                                           sniff but cough. Cat mojo love and coo around boyfriend who purrs and
                                                                                                                           makes the perfect moonlight eyes so i can purr and swat the glittery
                                                                                                                           gleaming yarn to him (the yarn is from a $125 sweater) for claw your
                                                                                                                           carpet in places everyone can see - why hide my amazing artistic
                                                                                                                           clawing skills?, thug cat.
                                                                                                                           </p>
                                                                                                                           <ul>
                                                                                                                           <li>Ooh, are those your $250 dollar sandals?</li>
                                                                                                                           <li>Lemme use that as my litter box behind the couch,</li>
                                                                                                                           <li>but if human is on laptop sit on the keyboard sit in window and stare</li>
                                                                                                                           <li>oooh, a bird, yum and stinky cat purr while eating.</li>
                                                                                                                           </ul>

                                                                                                                           <p>
                                                                                                                           Pet me pet me don't pet me i like frogs
                                                                                                                           and 0 gravity so attack feet. Destroy couch mrow sleeps on my head
                                                                                                                           suddenly go on wild-eyed crazy rampage or chase after silly colored
                                                                                                                           fish toys around the house so eats owners hair then claws head for hiss
                                                                                                                           at vacuum cleaner.
                                                                                                                           </p>
                                                                                                                           </div>

                                                                                                                           <div>
                                                                                                                           <h3> Forms & Buttons </h3>
                                                                                                                           <p>
                                                                                                                           Things and stuff, there are more words so that I can see if the things line up across columns and I think that they might and I'm really pumped about it.
                                                                                                                           </p>
                                                                                                                           <div class="form">
                                                                                                                                            <h4> Basic Information </h4>
                                                                                                                                            <div class="form__field">
              <label for="text">Name</label>
                               <input type="text" id="text" value="">
                                                                    </div>

                                                                    <div class="form__field">
                                                                                            <label for="street">Street Address</label>
                                                                                                               <input class="input--full-width" type="text" id="street" name="" value="">
            </div>

                                    <div class="form__field">
                                                            <label for="city">City</label>
                                                                             <input type="text" id="city" name="" value="">
                                                                                                                          </div>

                                                                                                                          <div class="form__field">
                                                                                                                                                  <label for="state">State</label>
                <input type="text" id="state" name="" value="">
                                                              </div>

                                                              <div class="form__field">
                                                                                      <label for="zip">Zip Code</label>
                                                                                                      <input type="number" id="zip" name="" value="">
                                                                                                                                                    </div>

                                                                                                                                                    <div class="form__actions">
              <a href="#" class="button">Cancel</a>
                                        <a href="#" class="button button--cta">Update Basic Information</a>
                                                                              </div>
                                                                              </div>

                                                                              <div class="form">
                                                                                               <h4> Contact Information </h4>
                                                                                               <div class="form__field">
                                                                                                                       <label for="email">Email</label>
                                                                                                                                         <input type="email" id="email" value="">
            </div>

            <div class="form__field">
                                    <label for="phone">Phone Number</label>
                                                      <input type="phone" id="phone" name="" value="">
                                                                                                     </div>

                                                                                                     <div class="form__actions">
                                                                                                                               <a href="#" class="button">Cancel</a>
              <a href="#" class="button button--cta">Update More Information</a>
                                                    </div>
                                                    </div>
                                                    </div>
                                                    </div>
                                                    </main>
                                                    </div>

              
            
!

CSS

              
                ///////////////////
// Establish the Grid
///////////////////

// Grid Variables
// Play with these to modify the grid!
$font-size-base: 20px;
$grid: 4px;

// Grid Function
@function grid($count) {
  @return calc(#{$grid} * #{$count});
}

// Reset browser defaults

body, html {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
ol,
ul,
blockquote,
p {
  margin: 0;
}

* {
  box-sizing: border-box;
  line-height: grid(7);
}




//////////////////
// Visual Styles and Using the Grid
//////////////////

// Functions

@function hover($color) {
  @return darken($color, 15%);
}

// Variables

// Color

$gray: #555;
$gray-light: #999;
$gray-lightest: #ededed;

$color-cta: #69c3e2;
$color-danger: #e05851;
$color-info: #eacd1f;

// Units
$unit-xs: 4px;
$unit-sm: 8px;
$unit-md: 16px;
$unit-lg: 32px;
$unit-xl: 40px;


// Typography
* {
  box-sizing: border-box;
  font-family: Helvetica, Arial;
}

body, html {
  color: #222;
  padding: $unit-md $unit-lg;
}

header {
  padding: $unit-lg 0;
}

h1 {
  font-size: 2.5em;
  line-height: grid(15);
  margin-bottom: grid(2);
}

h2 {
  font-size: 2em;
  line-height: grid(10);
  margin-bottom: grid(4);
}

h3 {
  font-size: 1.5em;
  line-height: grid(10);
  margin-bottom: grid(2);
}

h4 {
  color: $gray;
  font-size: 1.25em;
  margin-bottom: grid(2);
}

h5 {
  font-size: 1em;
  margin-bottom: grid(2);
}

h6 {
  font-size: .9em;
  margin-bottom: grid(2);
}

p + h1,
p + h2,
p + h3,
p + h4,
p + h5,
p + h6 {
  margin-top: grid(7);
}

.intro {
  font-size: 1.25em;
  line-height: grid(8);
  margin-bottom: grid(4);
}

p {

  + p {
    margin-top: grid(4);
    margin-bottom: grid(4);
  }
}

ul,
ol {
  margin-top: grid(7);
  margin-bottom: grid(7);
  padding-left: $unit-md;
}


// Sidebar
.sidebar {
  background-color: $gray-lightest;
  border-radius: $unit-sm;
  flex-grow: 1;
  margin-right: $unit-lg;
  padding: grid(5) grid(7);

  a {
    color: $gray;
    display: block;
    margin: grid(3) 0;
    text-decoration: none;

    :hover,
    :active,
    :focus {
      color: hover($gray);
    }
  }
}

// Form
.form {
  margin-top: $unit-lg;

  &__field {
    margin-bottom: grid(6);
  }
  
  &__actions {
    margin-top: grid(3);
  }
}

label {
  display: block;
  font-size: .8em;
  font-weight: bold;
  line-height: grid(4);
  margin-bottom: $unit-sm;
}

.input {

  &--full-width {
    width: 100%;
  }
}

input {
  border: 1px solid $gray-light;
  border-radius: $unit-sm;
  box-shadow: none;
  box-sizing: border-box;
  font-size: .9em;
  height: grid(8);
  outline: none;
  padding: 0 $unit-sm;

  &[type=text],
  &[type=textarea],
  &[type=number],
  &[type=phone],
  &[type=email] {

    &:hover {
      border-color: hover($gray-light);
    }

    &:focus {
      border-color: $color-info;
    }
  }

  &[type=radio],
  &[type=checkbox] {
    height: initial;

    + label {
      display: inline;
    }
  }
}

// Button
.button {
  background-color: $gray;
  border-radius: $unit-sm;
  color: white;
  display: inline-flex;
    align-items: center;
    justify-content: center;
  font-size: .8em;
  height: grid(8);
  padding: 0 $unit-lg;
  text-decoration: none;
  transition: all .3s ease;

  &:hover,
  &:active,
  &:focus {
    background-color: hover($gray);
  }

  &--cta {
    background-color: $color-cta;

    &:hover,
    &:active,
    &:focus {
      background-color: hover($color-cta);
    }
  }

  + .button {
    margin-right: $unit-md;
  }
}


// Layout 
.wrapper {
  display: flex;
    align-items: flex-start;
  margin: auto;
  max-width: 1200px;
  padding-bottom: grid(4);

  @media screen and (max-width: 768px) {
    display: block;
  }
}

header {
  padding: $grid 0;
}

main {
  flex-basis: 75%;
  padding-bottom: 2em;
}

.columns {
  display: grid;
  grid-gap: $unit-lg;
  
  &--2 {
    grid-template-columns: 1fr 1fr;
  }
}







/////////////////
// View Grid in Background
/////////////////
$minus-one: calc(#{$grid} - 1px);

.vertical-grid {
  background: repeating-linear-gradient(
    transparent,
    transparent $minus-one,
    #e05851 $minus-one,
    #e05851 $grid
  );
  display: none;
  height: 400%;
  position: absolute;
    left: 0;
    top: 0;
  width: 100%;
  z-index: -100;
}

#vertical-grid:checked ~ .vertical-grid {
  display: block;
}

              
            
!

JS

              
                
              
            
!
999px

Console