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

              
                <header id="main-header">
  <h1>TIMMY'S DINER</h1>
  <h5 class="upper">Breakfast, Lunch, and Dinner</h5>
</header>
<section id="menu-items">
  <h4 v-if="showSubtitle">Our Featured Items</h4>
  <section id="featured-items">
    <div class="card" v-for="product in products">
      <div class="card-img" v-bind:style="'background-image: url(' + product.imageURL + ')'"></div>
      <div class="card-body">
        <div class="price">${{ product.price }}</div>
        <h4 v-text="product.name">Steak Tacos</h4>
        <p v-html="product.description">Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
        <a v-bind:href="'product/' + product.itemID" class="btn">Learn More</a>
      </div>
    </div>
  </section>
</section>
              
            
!

CSS

              
                body, html {
  font-family: 'Century Gothic', Arial, sans-serif;
  color: #444;
  margin: 0;
  background-color: #e9e9e9;
}
h1,h2,h3 {
  font-family: Bookman, Palatino, serif;
  text-transform: uppercase;
  font-weight: normal;
}
h4,h5,h6 { font-weight: normal; }
.upper { text-transform: uppercase; }
#main-header {
  background: #f2f2f2;
  padding: 10px 40px;
  border-bottom: 1px solid #ddd;
}
#main-header h1 { margin-bottom: 0; }
#main-header h5 { margin-top: 0; }
#menu-items {
  padding: 10px 40px;
}
#featured-items {
  display: flex;
  justify-content: space-between;
}
.card {
  border: 1px solid #ccc;
  width: 200px;
  background-color: #fff;
}
.card-img {
  width: 200px;
  height: 140px;
  background-color: #eee;
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: cover;
}

.card-body {
  padding: 15px;
  color: #777;
}
.card-body h4 { font-weight: bold; margin: 0; }
.card-body .price {
  font-size: 20px;
  color: #D44;
  margin-bottom: 10px;
}
.card-body p { font-size: 14px; }
.card-body p:first-of-type {
  margin-top: 5px;
}
.btn {
  display: inline-block;
  text-decoration: none;
  text-transform: uppercase;
  background-color: #D44;
  color: #FFF;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 1px;
}
              
            
!

JS

              
                var menuData = {
  showSubtitle: true,
  products: [
    {
      name: "Steak Tacos",
      description: "Tacos with steak in them.",
      price: 12.99,
      itemID: 111,
      imageURL: "https://images.unsplash.com/photo-1504544750208-dc0358e63f7f?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=9dfe25991066270117d7353b756c7440"
    },
    {
      name: "Chicken Foodstuff",
      description: "Not sure what's in it, but I'm pretty sure the main ingredient is chicken.",
      price: 14.99,
      itemID: 112,
      imageURL: "https://images.unsplash.com/photo-1432139555190-58524dae6a55?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=df0fd3d35249887a0ce08a27adb37a56"
    },
    {
      name: "Steak a la Yummy",
      description: "Cooked how you like it on a bed of green and yellow stuff.",
      price: 44.99,
      itemID: 113,
      imageURL: "https://images.unsplash.com/photo-1504973960431-1c467e159aa4?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&s=e68d6e48b145f5992b178b438e029dc4"
    }
  ]
};

var myMenu = new Vue({
  el: '#menu-items',
  data: menuData
});
              
            
!
999px

Console