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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!– Message –>
<div class="o--message">
  <a href="http://kaustubhmenon.com/grid-layout-2/" target="_blank" title="Grid with Image Hover Distortion">
    <i class="fa fa-link" aria-hidden="true"></i>
  </a>
</div>

<!– Grid –>
<div class="o--grid">
  <!– Grid 1 –>
  <div class="o--grid__item o--grid--one">
    <div class="o--grid__content">
      <div class="o--grid__title o--grid__title--small">Home of the Vancouver Canucks</div>
      <div class="o--grid__text">Its diverse scenery has made Vancouver a popular filming location, earning it the nickname Hollywood North.</div>
      <a class="o--grid__link">Read More</a>
    </div>
  </div>
  <!– Grid 2 –>
  <div class="o--grid__item o--grid--two">
    <div class="o--grid__content">
      <div class="o--grid__title">Vancouver, British Columbia</div>
    </div>
  </div>
  <!– Grid 3 –>
  <div class="o--grid__item o--grid--three">
    <div class="o--grid__content">
      <div class="o--grid__title">Quebec City, Quebec</div>
    </div>
  </div>
  <!– Grid 4 –>
  <div class="o--grid__item o--grid--four">
    <div class="o--grid__content">
      <div class="o--grid__title o--grid__title--small">City with Walls</div>
      <div class="o--grid__text">A UNESCO World Heritage Site, Quebec City is the only city in Canada and the United States to still have its original city walls.</div>
      <a class="o--grid__link">Read More</a>
    </div>
  </div>
  <!– Grid 5 –>
  <div class="o--grid__item o--grid--five">
    <div class="o--grid__content">
      <div class="o--grid__title o--grid__title--small">City full of Skyscrapers</div>
      <div class="o--grid__text">With its skyscrapers overlooking the greenery of Prince’s Island Park, Calgary can easily remind you of New York City.</div>
      <a class="o--grid__link">Read More</a>
    </div>
  </div>
  <!– Grid 6 –>
  <div class="o--grid__item o--grid--six">
    <div class="o--grid__content">
      <div class="o--grid__title">Calgary, Alberta</div>
    </div>
  </div>
  <!– Grid 7 –>
  <div class="o--grid__item o--grid--seven">
    <div class="o--grid__content">
      <div class="o--grid__title">Toronto, Ontario</div>
    </div>
  </div>
  <!– Grid 8 –>
  <div class="o--grid__item o--grid--eight">
    <div class="o--grid__content">
      <div class="o--grid__title o--grid__title--small">Dynamic Metropolis</div>
      <div class="o--grid__text"> It's a dynamic metropolis with a core of soaring skyscrapers, all dwarfed by the iconic, free-standing CN Tower.</div>
      <a class="o--grid__link">Read More</a>
    </div>
  </div>
</div>
              
            
!

CSS

              
                // Base
//--------------------------------//
@import "compass";
*, ::after, ::before { @include box-sizing(border-box); }
html { width: 100%; height: 100%;}
body { width: 100%; height: 100%; background: #fff; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

// Variables
//--------------------------------//
$BG_COLOR:     #f6f6f6;  
$BLUE:        #3530f0;
$GREY_DARK:   #333;
$GREY_LIGHT:  #757575;

// Layout
//--------------------------------//

body {
  font-family: "Poppins", sans-serif;
  overflow: auto;
}

.o--message{
  position:fixed;
  bottom:2vh;
  right:2vw;
  padding:1rem;
  background:#fff;
  font-size:2rem;
  z-index:99;
  @include border-radius(50%);
  @include transition(all 0.3s);
  &:hover{
    @include box-shadow(0 7px 14px rgba(0,0,0,0.10), 0 5px 5px rgba(0,0,0,0.12));
  }
  a{
    color:#333;
    &:hover{
      color:#000;
    }
  }
}

.o--grid {
  position:relative;
  width:100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.o--grid__item {
  width: 100%;
  height: 50vh;
  position: relative;
	display: flex;
	align-items: stretch;
}

.o--grid__content {
  position: relative;
	width: 100%;
	display: flex;
	flex-direction:column;
  padding: 6vw;
  color:#fff;
	overflow: hidden;
}

.o--grid__title {
	font-weight: 700;
	font-size: 1.2rem;
	line-height: 1;
	margin:0;
	color: #fff;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.o--grid__title--small {
	font-size: 1.5rem;
	line-height: 1.25;
	margin-bottom: 0.25rem;
  text-shadow: none;
}

.o--grid__text {
	font-size: 1rem;
	line-height: 1.75;
	margin: 1.2rem 0;
}

.o--grid__link {
  position:relative;
	display:inline-block;
	font-weight: 700;
	font-size: 0.95rem;
	color: #fff;
  text-decoration:none;
  white-space: nowrap;
  margin-top: 1rem;
  align-self: flex-start;
  cursor:pointer;
  &:hover{
    &::before{
      opacity: 1;
	    transform: scale3d(1,1,1);
    }
  }
  &::before{
    content: '';
    position: absolute;
    background: #fff;
    width: 90%;
    height: 1px;
    bottom: -3px;
    transform-origin: 0% 50%;
    transform: scale3d(0,1,1);
    opacity: 0;
    @include transition(all 0.3s);
    @include transition-property(opacity, transform);
  }
}

.o--grid--one{
  background: #0c13c1;
  transition: all 0.3s;
  &:hover{
    background:lighten(#0c13c1, 3%)
  }
}

.o--grid--four{
  background: #d22851;
  transition: all 0.3s;
  &:hover{
    background:lighten(#d22851, 3%)
  }
}

.o--grid--five{
  background: #6317f5;
  transition: all 0.3s;
  &:hover{
    background:lighten(#6317f5, 3%)
  }
}

.o--grid--eight{
  background: #f7ac03;
  transition: all 0.3s;
  &:hover{
    background:lighten(#f7ac03, 3%)
  }
}

.o--grid--two{
  background: #ccc url('https://images.unsplash.com/photo-1519181258491-889c2b001485?ixlib=rb-0.3.5&s=76a0ff3ab7acc7f877fa479273cfc094&auto=format&fit=crop&w=1950&q=80') no-repeat center center;
  background-size:cover;
  @include filter(contrast(120%));
}

.o--grid--three{
  background: #ccc url('https://images.unsplash.com/photo-1519178614-68673b201f36?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=d1c6e96be62531ec1249e3e921d0c035&auto=format&fit=crop&w=1568&q=80') no-repeat center center;
  background-size:cover;
  @include filter(contrast(120%));
}

.o--grid--six{
  background: #ccc url('https://images.unsplash.com/photo-1526863336296-fac32d550655?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=3084c4e0c49cdf041910b0fb84e9074e&auto=format&fit=crop&w=1950&q=80') no-repeat center center;
  background-size:cover;
  @include filter(contrast(120%));
}

.o--grid--seven{
  background: #ccc url('https://images.unsplash.com/photo-1499447318306-5f520878fe20?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=3cf98d330ce003ac831432908398ba84&auto=format&fit=crop&w=1950&q=80') no-repeat center center;
  background-size:cover;
  @include filter(contrast(120%));
}

@media screen and (max-width: 1024px) {
  
  .o--grid {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
  }

  .o--grid--two, .o--grid--three, .o--grid--six, .o--grid--seven{
    display:none;
  }
  
  .o--grid__content {
    padding: 8vw;
  }
  
}



              
            
!

JS

              
                
              
            
!
999px

Console