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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                
<head>
<script src="/assets/jquery.js"></script>
<link href='https://fonts.googleapis.com/css?family=Londrina+Shadow' rel='stylesheet' type='text/css'>


</head>

<body>
<h1>Sweeties Bakery</h1>
<h2>LA's Tastiest Treat</h2>
<ul>
<li><a href="#">More Sweets</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Our Location</a></li>
</ul>
<div class="first">
  <p>Cupcakes <span class="price">$2.50</span><br />
  <small>Mustard sierra leone bologi kale chard beet greens black-eyed pea sorrel amaranth garlic tigernut spring onion summer purslane asparagus lentil. </small></p>
</div>

<div class="second">
  <p>Cakes <span class="price">$22-$30</span><br />
  <small>Tri-tip capicola kielbasa salami brisket chicken rump strip steak drumstick. Meatloaf chuck boudin ribeye pork jowl. Andouille bacon jowl meatloaf pork loin prosciutto bresaola.</small></p>
</div>
  
<div class="dessert">
  <p>Pies <span class="price">$10</span><br />
  <small>Lollipop tart cotton candy jelly-o carrot cake apple pie cupcake. Jelly-o bear claw ice cream candy canes.</small></p>
</div>


</body>

              
            
!

CSS

              
                body {
  font-family: helvetica, sans-serif;
  margin: 0 auto;
  max-width: 600px;
  background: url("https://img0.etsystatic.com/016/0/6220571/il_fullxfull.426855582_be0l.jpg");
}

li {
  display: inline;
  padding: 55px;
  
  }

ul {
  background: black;
  padding: 5px;

}

a {
  color: pink;
}
div {
  height: 200px;
  background-size: cover;
  position: relative;
  margin: 40px 0 0 0;
  border-radius: 15px;
}
h1 {
  font-family: 'Londrina Shadow', cursive;
  text-align: center;
  font-size: 75px;
  color: #000000 ;
  margin: 60px 0 0 0;
  animation: myfirst 5s infinite;
  animation-direction: alternate;
}
h2 {
  text-align: center;
  color: ##000000 ;
  margin: 0px 0 70px 0;
}
p {
  color: rgba(255,255,255,1);
  background: black;
  background: linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
  background: -webkit-linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
  background: -moz-linear-gradient(bottom, rgba(0,0,0,1), rgba(0,0,0,.4));
  padding: 10px;
  line-height: 28px;
  text-align: justify;
  position: absolute;
  bottom: 0;
  margin: 0;
  height: 30px;
  transition: height .5s;
  -webkit-transition: height .5s;
  -moz-transition: height .5s;
  
}

small {
  opacity: 0;
}

.show-description p {
  height: 150px;
}

.show-description small {
  opacity: 1;
}

.first{
  background-image: url("http://www.wbnq.com/wp-content/uploads/sites/377/2015/05/1-6-2015-cupcakes-generic.jpg");
}
.second{
  background-image: url("https://www.taystful.co.uk/images/home-slides/cake-courses.jpg");
}
.dessert{
  background-image: url("http://www.saveur.com/sites/saveur.com/files/import/2013/images/2013-07/7-travels_big-pie-country-pies_1500x993.jpg");
}
.price {
  float: right;
}
@media (max-width: 500px) {
  h1 {
    font-size: 50px;
    margin-top: 20px;
    line-height: 40px;
    -webkit-animation: myfirst 5s infinite; 
    -webkit-animation-direction: alternate;
    
  }
  h2 {
    font-size: 20px;
    margin: 20px 0 30px 0;
  }
  div {
    margin: 20px 12px 0 12px;
  }
  p {
    font-size: 20px;
    line-height: 24px;
  }
  small {
    font-size: 16px;
  }
  
  li {
    display: block;
    padding: 0px 80px;
    }
}


              
            
!

JS

              
                  $('div').on('click', function() {
      $(this).toggleClass('show-description');
  });

              
            
!
999px

Console