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 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

              
                <div class="card">
  <div class="cardTop">
  </div>
  <div class="cardBottom">
    <div class="cardText">
      <!--       Title and description will always show -->
      <h3 class="cardTitle">Title</h3>
      <h4 class="cardInfo">Short Description</h4>
      <!--       Only visibile when parent element is hovered over -->
      <div class="cardHoverText">
        Lorem Ipsum
        <ul>
          <li>What is Lorem Ipsum?</li>
          <li>rambled it to make a type specimen book. It has survived</li>
          <li>centuries, but also the leap into electronic typesettingessent</li>
        </ul>
      </div>
      <!--       Only visibile when parent element is hovered over -->
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  background-color: lightgrey;
}

/* Transistion both your normal and hovered elements to allow for smooth flow when unhovered */

.card {
  background: white;
  margin-top: 40px;
  height: 400px;
  width: 25%;
  transition: 0.6s all ease;
  margin-left: auto;
  margin-right: auto;
}

/* I used background url to allow me to change the height and width without needing extra css */

.cardTop {
  transition: 0.4s all ease;
  height: 65%;
  background: url("https://i.ytimg.com/vi/lt0WQ8JzLz4/maxresdefault.jpg")
    no-repeat;
}

.cardBottom {
  height: 35%;
  text-wrap: normal;
  transition: 0.4s all ease;
}

.cardText {
  min-height: 100%;
  padding: 20px;
}

.cardTitle {
  font-size: 24px;
  font-weight: 700;
}

.cardInfo {
  padding-top: 10px;
  font-size: 18px;
  font-weight: 500;
  color: orange;
}

/* Hidding the entire so anything we put in will only show on hover */

.cardHoverText {
  visibility: hidden;
}

/* Hover affects */

.card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Using className + hover followed by child element allows you to change child elements when parent is hovered */

.card:hover .cardHoverText {
  visibility: visible;
  transition: 0.4s all ease;
  transition-delay: 0.1999s;
}

.card:hover .cardBottom {
  transition: 0.4s all ease;
  height: 65%;
  opacity: 1;
}

.card:hover .cardTop {
  height: 35%;
  opacity: 0.8;
  transition: 0.4s all ease;
}

              
            
!

JS

              
                
              
            
!
999px

Console