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

              
                <html>
<head>
	<title>BEVM Card</title>
	<style type="text/css">
		.card__image {
			background-image: url(https://picsum.photos/500/500);
		} 
	</style>
</head>
<body>
	<!-- card -->
	<div class="c-card">
		<!-- card header -->
		<div class="c-card__header">
      <div class="c-card__date -round">
        <div class="c-card__day">27</div>
        <div class="c-card__month">Mai</div>
      </div>
      <div class="c-card__tag">Design</div>
      <div class="c-card__image"></div>
		</div>

		<!-- card body -->
		<div class="c-card__body">
			<h2 class="c-card__headline">Don't make me think</h2> 
			<h3 class="c-card__subheadline">The design of everyday things</h3>
			<p class="c-card__text">Lorem ipsum dolor sit amet consectetur adipisicing elit. Placeat inventore alias quia eum commodi eligendi earum error aliquid eaque. Fuga modi non reiciendis dolores, aliquam esse similique excepturi est temporibus!</p>
		</div>

		<!-- card footer -->
		<div class="c-card__footer">
			<ul class="c-list--horizontal">
				<li class="c-list__item | c-card__time-to-read">
          <i class="far fa-clock"></i><span class="c-card__time-to-read__label">6 min read</span>
				</li>
				<li class="c-list__item | c-card__comments">
          <i class="far fa-comments"></i><a href="#">42 comments</a>
        </li>
			</ul>
		</div>
	</div>

</body>
</html>
              
            
!

CSS

              
                $highlight: #e74c3c;
$white: #fefefe;
$light-gray: #ecf0f1;
$dark-gray: #7f8c8d;

body {
  background-color: $light-gray;
  display: flex;
  justify-content: center;
  font-family: "Lato", sans-serif;
  margin-top: 3em;
}

.c-card {
  background-color: $white;
  width: 300px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.16), 
              0 3px 6px rgba(0,0,0,0.23);
  transition: box-shadow 0.3s cubic-bezier(.25,.8,.25,1);
  
  &:hover {
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 
                0 10px 10px rgba(0,0,0,0.22);
    
    .c-card__tag, .c-card__date {
      opacity: .7;
      transition: opacity ease .25s;
    }
    
    .c-card__image {
      height: 165px;
      transition: height ease .5s;
    }
    
    .c-card__body {
      margin-top: -15px;
      transition: margin-top ease .5s;
    }
  }
  
  &__header {
    position: relative;
  }
  
  &__date, &__tag {
    transition: opacity ease .25s;
  }
  
  &__date {
    position: absolute;
    background: $highlight;
    font-weight: 700;
    font-size: .7em;
    text-transform: uppercase;
    color: $white;
    width: 3.7em;
    height: 3.7em;
    border-radius: 2em;
    letter-spacing: .1em;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 1em;
  }
  
  &__image {
    background-image: url(https://picsum.photos/500/500/?random);
    background-repeat: no-repeat;
    background-position: center;
    height: 150px;
    transition: height ease .5s;
  }
  
  &__tag {
    position: absolute;
    background: $highlight;
    color: $white;
    font-size: .7em;
    font-weight: 700;
    text-transform: uppercase;
    bottom: 0;
    right: 0;
    padding: .5em 1em;
    letter-spacing: .1em;
    
    a {
      color: currentColor;
      text-decoration: none;
    }
  }
  
  [class$="headline"] {
    margin-top: 0;
    margin-bottom: 0;
  }
  
  &__headline {
    margin: 0 0 2.5em 0;
  }
  
  &__subheadline {
    margin-top: 0;
    color: $highlight;
    font-size: .95em;
  }
  
  &__body {
    padding: 1em;
    padding-bottom: 0;
    margin-bottom: 2em;
    transition: margin-top ease .5s;
  }
  
  &__text {
    color: $dark-gray;
    font-size: .75em;
    line-height: 2;
  }
  
  .c-card__time-to-read__label {
    margin-left: .2em;
  }
}



.c-list--horizontal {
  list-style: none;
  padding: 1em;
  padding-top: 0;
  
  .c-list__item {
    color: $dark-gray;
    font-size: .7em;
    float: left;
    
    &:not(:last-child) {
      margin-right: 1em;
    }
    
    a {
      color: currentColor;
      text-decoration: none;
      padding: .2em;
      margin: -.2em;
      margin-left: .2em;
      
      &:hover {
        color: $white;
        transition: color ease .2s .3s, 
                    background ease .2s .2s;
        background: $highlight;
      }
    }
  }
}
  
              
            
!

JS

              
                
              
            
!
999px

Console