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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <html lang="en">
  <head>
   <title>Flexbox Three Columns Layout</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link href="https://fonts.googleapis.com/css?family=Dancing+Script|Montserrat:300,400,500" rel="stylesheet"> 
  </head>
  
  <body>
    
    <div class="header">
       <h1>CSS Grid Layout</h1>
       <h2>
        <span class="yellow">With</span>
        <span class="rose">great</span>
        <span class="blue">gradients</span>
       </h2>
    </div>
   
    <div class="grid-container">
      
      <div class="grid1 grid">
        <div class="square square1"></div>
        <p class="numbers">1</p>
      </div>
      
      <div class="grid2 grid">
        <div class="square"></div>
        <p class="numbers">2</p>
      </div>
      
      <div class="grid3 grid">
        <div class="square"></div>
        <p class="numbers">3</p>
      </div>
      
      <div class="grid4 grid">
        <div class="square"></div>
        <p class="numbers">4</p>
      </div>
      
      <div class="grid5 grid">
        <div class="square"></div>
        <p class="numbers">5</p>
      </div>
      
      <div class="grid6 grid">
        <div class="square"></div>
        <p class="numbers">6</p>
      </div>
      
      <div class="grid7 grid">
        <div class="square"></div>
        <p class="numbers">7</p>
      </div>
      
      <div class="grid8 grid">
        <div class="square"></div>
        <p class="numbers">8</p>
      </div>
      
      <div class="grid9 grid">
        <div class="square"></div>
        <p class="numbers">9</p>
      </div>
      
      <div class="grid10 grid">
        <div class="square"></div>
        <p class="numbers">10</p>
      </div>
      
      <div class="grid11 grid">
        <div class="square"></div>
        <p class="numbers">11</p>
      </div>
      
      <div class="grid12 grid">
        <div class="square"></div>
        <p class="numbers">12</p>
      </div>
      
      <div class="grid13 grid">
        <div class="square"></div>
        <p class="numbers">13</p>
      </div>
      
      <div class="grid14 grid">
        <div class="square"></div>
        <p class="numbers">14</p>
      </div>
    </div>
  </body>
</html>  
              
            
!

CSS

              
                * {
  box-sizing: border-box;
}
body {
  background-color: #08161e;
}
h1 {
  color: #fff;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 62px;
  font-weight: 400;
  text-transform: uppercase;
}
h2 {
  color: #fff;
  text-align: center;
  font-family: 'Dancing Script', cursive;
  font-size: 52px;
  font-weight: 400;
  margin-top: -80px;
}
.yellow {
  color: #dfe084;
}
.rose {
  color: #e098cb;
}
.blue {
  color: #48bcff;
}
.grid-container {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat (5, 20%);
  grid-template-rows: repeat (5, 1fr);
  grid-gap: 10px;
}
.grid1 {
  grid-area: 1 / 1 / span 2 / span 3;
  background: linear-gradient(to top right, #b7a3e0, #e098cb);
  height: 210px;
}
.grid1:hover {
  background: linear-gradient(to bottom left, #b7a3e0, #e098cb);
}
.grid2 {
  grid-area: 1 / 4 / span 1 / span 2;
  background: linear-gradient(to top right, #48bcff, #5cffcf);
  height: 100px;
}
.grid3 {
  grid-area: 2 / 4 / span 1 / span 2;
  background: linear-gradient(to top right, #48bcff, #5cffcf);
  height: 100px;
}
.grid2:hover, .grid3:hover {
    background: linear-gradient(to bottom left, #48bcff, #5cffcf);

}
.grid4 {
  grid-area: 3 / 1 / span 1 / span 5;
  background: linear-gradient(to bottom left, #b7a3e0, #e098cb);
  height: 100px;
}
.grid4:hover {
    background: linear-gradient(to top right, #b7a3e0, #e098cb);
}
.grid5 {
  grid-area: 4 / 1 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;

}
.grid6 {
  grid-area: 4 / 2 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid7 {
  grid-area: 4 / 3 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid8 {
  grid-area: 4 / 4 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid9 {
  grid-area: 4 / 5 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid10 {
  grid-area: 5 / 1 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid11 {
  grid-area: 5 / 2 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid12 {
  grid-area: 5 / 3 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid13 {
  grid-area: 5 / 4 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid14 {
  grid-area: 5 / 5 / span 1 / span 1;
  background: linear-gradient(to top right, #dfe084, #ff5454);
  height: 100px;
}
.grid5:hover, .grid6:hover, .grid7:hover, .grid8:hover, .grid9:hover, .grid10:hover, .grid11:hover, .grid12:hover, .grid13:hover, .grid14:hover {
    background: linear-gradient(to bottom left, #dfe084, #ff5454);
}
.numbers {
  position: relative;
  display: block;
  color: #000;
  text-align: center;
  margin-top: -60px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}
.square {
  display: flex;
  content: "";
  border: solid 1px #fff;
  border-radius: 5px;
  width: 50px;
  height: 50px;
  background-color: #fff;
  transform: rotate(45deg);
  margin: 25px auto;
}
.square1 {
  margin-top: 80px;
}
.square:hover {
  -webkit-animation:spin 5s linear infinite;
    -moz-animation:spin 5s linear infinite;
    animation:spin 5s linear infinite;
}
@-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
@-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
              
            
!

JS

              
                
              
            
!
999px

Console