cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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="container">
  <img class="" src="http://holdencreative.com/wordpress/wp-content/uploads/2014/12/potato-731x510.jpg" />
  <h2>Calc and vw rules</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Culpa facilis, labore debitis nesciunt ipsam odio corporis architecto reiciendis voluptas ab quibusdam ratione rerum tempore voluptatibus libero cumque dignissimos vero hic!</p>
</div>
            
          
!
            
              * { box-sizing: border-box; }

@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,900);

body {
  font-family: 'Source Sans Pro', sans-serif;
  background: #ccc;
}
h2 {
  font-size: 1.5em;
  line-height: 1.5rem;
  text-transform: none;
}
p {
  font-size: 1rem;
  line-height: 1.5rem;
}
.container {
  width: 300px;
  margin: 1rem;
  padding: 1rem;
  background: #f5f5f5;
  color: #454545;
  border: 1px solid #3F51B5;
  overflow: hidden;
}
.fullwidth-for-small {
  margin: 0 -1rem;
}
img {
  display: block;
  background-size: cover;
  background-position: center;
  background-repeat:  no-repeat;
  width: auto;      /* fallback */
  max-width: 100%;  /* fallback */
  width: calc(100% + 2em); /* modern browsers */
  max-width: 100vw;        /* assumes content is full viewport width */
  position: relative;
  left:  -1em;
  right: -1em;
}


            
          
!
999px
Loading ..................

Console