cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <div class="wrap">
  <h1>Background Color on Columns </h1>

	<div class="container1">
		<div class="column1">
    	<h2>Column 1</h2>
      <p>Column 1 is longer than the 2nd column, and the columns are different heights.</p>
      <p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.</p>
    </div>
    <div class="column2">
    	<h2>Column 2</h2>
      <p>This is column 2. It is much shorter than column 1</p>
    </div>
    
  </div><!-- container1 --> 
</div><!-- wrap -->
<div class="wrap">
	<h1>Background Gradient on Container</h1>
  
	<div class="container2">
		<div class="column1">
    	<h2>Column 1</h2>
      <p>Because the background of the container has the gradient, the columns appear to be the same height.</p>
      <p>Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.</p>
    </div>
    <div class="column2">
    	<h2>Column 2</h2>
      <p>This is column 2. It is much shorter than column 1</p>
    </div>
    
  </div><!-- container2 -->  
</div><!-- wrap -->
            
          
!
            
              /* Set up */
* { box-sizing: border-box; }
body { 
  font-family: 'Open Sans', serif;
  line-height: 1.5;
}
h1 { 
  font-size: 1.3em;
}
.wrap {
  width: 47%;
  margin: 1.5%;
  float: left;
}
.container1, .container2 { 
  width: 100%; 
  overflow: auto;
}

.column1, .column2 {
  padding: 3%;
  float: left;
}

/* Example 1: color on columns */
.column1 {
  background-color: #a2ea4c;
  width: 60%;
}
.column2 {
  background-color: #07aa91;
  width: 40%;
}

/* Example 2: color on container, as a gradient */

/* This is only to reset column colors that I set in first example. 
   You would not need this in your code, if only using example 2 
*/
.container2 .column1,
.container2 .column2 {
  background-color: transparent;
}

/* Gradient for container */
.container2 {
  background: #a2ea4c;  
  background-image: -webkit-linear-gradient(left, #a2ea4c 60%, #07aa91 60%, #07aa91 100%);
  background-image: linear-gradient(left, #a2ea4c 60%, #07aa91 60%, #07aa91 100%);
}



            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console