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 class="c-restaurant">
    <div class="c-panel">
      <h3 class="c-panel--title">To Go Menu</h3>
      
      <ul class="c-menu__list" role="list">

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__french-fries.png" alt="Plate of french fries with ketchup" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">French Fries with Ketchup</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__salmon-vegetables.png" alt="Plate of salmon and vegetables" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">Salmon and Vegetables</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__spaghetti-meat-sauce.png" alt="Plate of spaghetti with meat sauce" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">Spaghetti with Meat Sauce</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__french-fries.png" alt="Plate of french fries with ketchup" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">French Fries with Ketchup</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__ravioli.png" alt="Plate of ravioli" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">Ravioli</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__fish-sticks-fries.png" alt="Plate of fish sticks and fries" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">Fish Sticks and Fries</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__tortellini.png" alt="Plate of tortellini" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">Tortellini</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

        <li class="c-menu__list--item">
          <div class="c-plate">
            <figure class="c-plate__image">
              <img src="https://codepen.davidroessli.com/img/plate__chicken-salad.png" alt="Plate of chicken salad" class="img-responsive" />
            </figure>
            <div class="c-plate__meta">
              <p class="c-plate__meta--desc">Chicken Salad</p>
              <p class="c-plate__meta--price">$4.50</p>
              <button name="add2cart" type="button" class="c-plate__meta--action">Add to Cart</button>
            </div>
          </div>
        </li>

      </ul>
      
    </div>
    <div class="c-panel">
      <h3 class="c-panel--title">Your Cart</h3>
      <p>Your cart is empty.</p>
    </div>
  </div>

              
            
!

CSS

              
                :root {
  --background-color: #EFF0F6;
  --border-color: #d7d6fc;
  --primary-purple: #6B00F5;
  --pattens-blue: #e1f0fe;
  --ghost-white: #f7f7ff;
  --white-ice: #defef0;
  --light-pink: #fbe4f0;
  --light-green: #e4fcf0;
  
  --gutter: 25px;
}
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--background-color);
  background-image: url(https://codepen.davidroessli.com/img/bg__top-right.svg), url(https://codepen.davidroessli.com/img/bg__left.svg), url(https://codepen.davidroessli.com/img/bg__btm-right.svg);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: top right, left, bottom right;

  display:flex;
  flex-direction: column;
  justify-content: center;
}
h3 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 3rem;
}
.c-restaurant {
  display:flex;
  flex-direction: row;
  justify-content: center;
}
.c-panel {
  background-color: white;
  border-radius: var(--gutter);
  margin:0 var(--gutter);
  padding: calc(var(--gutter) * 2) calc(var(--gutter) * 1.28);
  width: 375px;
  height: 80vh;
  overflow-y: scroll;
}
.c-panel--title {
  margin-bottom:2rem;
}
.c-menu__list {
}
.c-menu__list--item {
  margin: calc(var(--gutter) * 1.5) calc(var(--gutter) * -1.28) calc(var(--gutter) * 1.5) 0;
  border-radius: var(--gutter) 0 0 var(--gutter);
}
.c-menu__list--item:nth-of-type(1n) {
  background-color: var(--pattens-blue);
}
.c-menu__list--item:nth-of-type(2n) {
  background-color: var(--light-pink);
}
.c-menu__list--item:nth-of-type(3n) {
  background-color: var(--ghost-white);
}
.c-menu__list--item:nth-of-type(4n) {
  background-color: var(--light-green);
}
.c-plate {
  display:flex;
  flex-direction: row;
  justify-content: center;
}
.c-plate__image {
  position: relative;
  width:225px;
  flex: 1;
}
.c-plate__image img {
  max-width: 100%;
  width:148px;
  position: absolute;
  top: -1.25rem;
  left: -1.25rem;
}
.c-plate__meta {
  position: relative;
  padding: 1.5rem 2rem 0 0;
  flex: 1;
}
.c-plate__meta--desc {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.25;
}
.c-plate__meta--price {
  font-size: 2rem;
  font-weight: 700;
  line-height: 2;
  margin:0 0 1rem 0;
}
.c-plate__meta--action {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 4px 18px;
  position: absolute;
  bottom: -1rem;
}
[name="add2cart"] {
  background: #6B00F5;
  border-radius: 20px;
  color: white;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}
              
            
!

JS

              
                
              
            
!
999px

Console