cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <h1 class="title">UI - Card Design</h1>

<article class="card">
  <header class="card__thumb">
    <a href="#"><img src="http://lorempicsum.com/futurama/370/245/3"/></a>
  </header>
  <date class="card__date">
    <span class="card__date__day">11</span>
    <br/>
    <span class="card__date__month">Juin</span>
  </date>
  
  <div class="card__body">
    <div class="card__category"><a href="#">Photos</a></div>
    <h2 class="card__title"><a href="#">We're on a highway to hell!</a></h2>
    <div class="card__subtitle">Bender is frying Doc !</div>
    <p class="card__description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit cumque non commodi, modi recusandae cupiditate ipsa ab soluta. Illum, dolore.</p>
  </div>
  
  <footer class="card__footer">
    <span class="icon ion-clock"></span> 6min ago
    <span class="icon ion-chatbox"></span><a href="#"> 42 comments</a>
   </footer>
</article>
            
          
!
            
              /**
* VARIABLES
**/

$duration: 0.5s;
$delay: 0.2s;
$color: coral;

* { box-sizing: border-box; }

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);

body{
  font-family: "Open Sans";
  font-size:16px;
   background-color: #eee;
}

/**
* Title
**/
.title{ 
  text-align: center;
  transform: translateY(20px);
  font-size: 45px;
  
  color: $color;
  text-transform: uppercase;
}

/**
* CARD
**/

.card {
  position: absolute;
  top: 50%;  left: 50%;
  transform :  translateX(-50%) translateY(-50%) translateZ(0);
  
  width:370px;
  
  background-color: #fff;
  box-shadow:0 0 20px rgba(black,0.1);
  
  overflow:hidden;
  
  transition: box-shadow $duration;
  
  a{
    color:inherit;
    text-decoration: none;
  }
}

.card:hover{
  box-shadow:0 0 50px rgba(black,0.3);
}


/**
* DATE
**/

.card__date{
  position: absolute;
  top: 20px;
  right: 20px;
  
  width: 45px;
  height: 45px;
  padding-top:10px;
  
  background-color: $color;
  border-radius: 50%;
  
  color:#fff;
  
  text-align: center;
  font-weight: 700;
  line-height: 13px;


  &__day{
    font-size:14px;
  }

  &__month{
    text-transform: uppercase;
    font-size:10px;
  }
}


/**
* THUMB
**/

.card__thumb{
  height: 245px;
  
  overflow:hidden;
  
  background-color: #000;
  
  transition: height $duration;
  
  img{
    display:block;
    opacity: 1;
    
    transform: scale(1);
    
    transition: opacity $duration, transform $duration;
  }
  
  .card:hover &{
    height: 130px;
  }
}

.card:hover .card__thumb img{
  opacity: 0.6;
  transform: scale(1.2);
}


/**
* BODY
**/

.card__body{
  position: relative;
  height: 185px;
  
  padding:20px;
  
  transition: height $duration;
  
  .card:hover &{
    height: 185px + 115px;
  }
}

.card__category{
  position: absolute;
  top: -25px;  left: 0;
  
  height: 25px;
  
  padding:0 15px;
  background-color: $color;
  
  color:#fff;
  text-transform: uppercase;
  font-size:11px;
  line-height: 25px;
}

.card__title{
  margin: 0; padding: 0 0 10px 0;
  
  color: #000;
  font-size: 22px;
  font-weight: bold;
  text-transform: uppercase;
}

.card__subtitle{
  margin: 0; padding: 0 0 10px 0;
  
  font-size: 19px;
  color: $color;
}

.card__description{
  position: absolute;
  left: 20px; right: 20px;
  bottom: 56px;
  
  margin: 0; padding: 0;
  
  color: #666C74;
  line-height: 27px;
  
  opacity:0;
  transform: translateY(45px);
  
  transition: opacity $duration -$delay, transform $duration -$delay;
  transition-delay: 0s;
  
  
  
  .card:hover &{
    opacity:1;
    transform: translateY(0);
    transition-delay: $delay;  
  }
}

.card__footer{
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 20px;
  
  font-size: 11px;
  color:#A3A9A2;
}

.icon{
  display: inline-block;
  vertical-align: middle;
  margin: -2px 0 0 2px;
  font-size: 18px;
  
  & + &{
    padding-left:10px;
  }
}
            
          
!
999px
Loading ..................

Console