Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div id="card">
  <div id="top-section">
    <h2>Join our community</h2>
    <h4>30-day, hassle-free money back guarantee</h4>
    <p>Gain access to our full library of tutorials along with expert code reviews.  Perfect for any developers who are serious about honing their skills.</p>
  </div>
  <div id="bottom-section">
    <div id="bottom-left-section">
      <h4>Monthly Subscription</h4>
      <div id="price-container">
        <div id="price">$29</div>
        <div id="price-frequency">per month</div>
      </div>
      <p>Full access for less than $1 a day</p>
      <button onclick="alertUser()">Sign Up</button>
    </div><div id="bottom-right-section">
      <h4>Why Us</h4>
      <ul>
        <li>Tutorials by industry experts</li>
        <li>Peer & expert code review</li>
        <li>Coding exercises</li>
        <li>Access to our GitHub repos</li>
        <li>Community forum</li>
        <li>Flashcard decks</li>
        <li>New videos every week</li>
      </ul>
    </div>
  </div>
</div>
              
            
!

CSS

              
                html {
  box-sizing: border-box;
  font-family: 'Karla';
  font-size: 16px;
  font-weight: 400;
}

body {
  padding: 20px;
}

h2, h4, p {
  margin: 0;
}

*, *:before, *:after {
  box-sizing: inherit;
}

#card {
  width: 600px;
  height: 400px;
  box-shadow: 2px 3px 7px 0px rgba(0,0,0,0.35);
  border-radius: 5px;
  overflow: hidden;
}

#top-section {
  width: 100%;
  height: 45%;
  padding: 25px;
}

#bottom-section {
  width: 100%;
  height: 55%;
  color: white;
}

#bottom-left-section {
  display: inline-block;
  width: 50%;
  height: 100%;
  vertical-align: top;
  background-color: #2ab2af;
  padding: 25px;
}

#bottom-right-section {
  display: inline-block;
  width: 50%;
  height: 100%;
  background-color: #2EBFBD;
  vertical-align: top;
  padding: 25px;
}

#top-section h2 {
  color: #2ab2af;
  margin-bottom: 20px;
}

#top-section h4 {
  color: #c0df34;
  margin-bottom: 10px;
}

#top-section p {
  color: #98a6bd;
}

button {
  color: white;
  background-color: #c0df34;
  border: none;
  padding: 10px;
  width: 100%;
  border-radius: 5px;
}

button:hover {
  cursor: pointer;
  background-color: #A9C42D;
  transform: scale(1.02);
}

#price {
  font-weight: 700;
  font-size: 1.4rem;
}

#bottom-left-section h4 {
  margin-bottom: 25px;
}

#bottom-left-section p {
  font-size: 0.8rem;
  margin-bottom: 40px;
}

#price-frequency, #price {
  display: inline-block;
}

#price-frequency {
  position: relative;
  top: -3px;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-left: 5px;
}

#price-container {
  margin-bottom: 10px;
}

ul {
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  opacity: 0.8;
}

@media (max-width: 650px) {
  #card, #bottom-left-section, #bottom-right-section {
    width: 100%;
    height: auto;
  }
}
              
            
!

JS

              
                function alertUser() {
  alert('Hey, you clicked the button!');
}
              
            
!
999px

Console