Sample - step 3

In this example below you will see how to do a Sample - step 3 with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by tibomahe, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright tibomahe ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Sample - step 3</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">

  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <a href="#" class="c-card-media u-margin-m">

  <img class="c-card-media__background" src="https://media.skippair.com/media/cache/e3/53/e3537c6ab88708a67777e5ec1bbc6f4e.jpg">

  <div class="c-pill c-pill--secondary u-padding-m u-margin-s">Sailboat</div>

  <div class="c-card-media__content u-center">

    <img class="c-avatar" src="https://media.skippair.com/media/cache/10/f8/10f83518c952d19297c1e5131996440e.jpg" alt="">

    <h3 class="c-h3 u-white u-padding-m">Croisière journée Chausey ou Saint-Malo</h3>

    <div class="c-band c-band--primary u-padding-m u-margin-l-hz">
      dès <span class="c-big-number">50</span><span class="c-big-number">€</span> /pers - 1 jour(s)
    </div>

  </div>

</a>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/tibomahe/sample-step-3-KvYRpZ */
body {
  font-size: 15px;
  font-family: Helvetica;
}

a {
  text-decoration: none;
}

/* Options */
/* Decisions */
.c-h3 {
  line-height: 1rem;
  font-size: 1.2em;
  font-weight: 400;
}

.c-big-number {
  font-size: 1.8em;
  font-weight: 800;
}

.c-avatar {
  display: block;
  height: 60px;
  width: 60px;
  border-radius: 50%;
  border: 1px solid #fff;
}

.c-band {
  display: block;
}
.c-band--primary {
  background-color: #00cccc;
  color: #fff;
}

.c-pill {
  display: inline-block;
  line-height: 1.3;
  border-radius: 3px;
  font-weight: 800;
  text-transform: uppercase;
}
.c-pill--secondary {
  background-color: #4965b5;
  color: #fff;
}

.c-card-media {
  display: block;
  position: relative;
  width: 300px;
  height: 300px;
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s linear;
}
.c-card-media__background {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  z-index: -1;
}
.c-card-media__content {
  position: absolute;
  bottom: 0;
}
.c-card-media__content:before {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  z-index: -1;
  width: 100%;
  height: calc(100% - 60px / 2);
  background-color: rgba(0, 0, 0, 0.5);
}
.c-card-media .c-pill {
  position: absolute;
  top: 0;
  right: 0;
}
.c-card-media .c-avatar {
  margin: auto;
}
.c-card-media:focus, .c-card-media:hover {
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
}

.u-white {
  color: #fff;
}

.u-center {
  text-align: center;
}

.u-padding-m {
  padding: calc(8 * 1px);
}

.u-margin-s {
  margin: calc(4 * 1px);
}

.u-margin-m {
  margin: calc(8 * 1px);
}

.u-margin-l-hz {
  margin-left: calc(16 * 1px);
  margin-right: calc(16 * 1px);
}

Comments