<div class="widget">
  <h3 class="widget__title">
    Excepteur
  </h3>
  
  <p class="widget__text">
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  </p>
  
  <a class="widget__link" href="#">
    Read more
  </a>
</div>

<div class="widget widget--red">
  <h3 class="widget__title">
    Excepteur
  </h3>
  
  <p class="widget__text">
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  </p>
  
  <a class="widget__link" href="#">
    Read more
  </a>
</div>
:root {
  --body-bg: whitesmoke;
  --card-bg: #FFF;
  --border: #CCC;
  --shadow: rgba(0,0,0,.1);
  --title: teal;
  --text: #333;
  --link: mediumseagreen;
  --link-hover: turquoise;
}

.widget--red {
  --card-bg: mistyrose;
  --border: tomato;
  --shadow: rgba(200,0,0,.2);
  --title: orangered;
  --link: tomato;
  --link-hover: crimson;
}

BODY {
  background: var(--body-bg);
}

.widget {
  width: 250px;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow);
  color: var(--text);
}

.widget__title {
  margin: 0 0 .5em;
  padding-bottom: .25em;
  border-bottom: 5px solid var(--title-border);
  font-size: 1.75rem;
  font-family: Georgia, serif;
  font-weight: normal;
  color: var(--title);
  
  &::after {
    content: '';
    display: block;
    width: 100%;
    height: .75rem;
    margin-top: 1rem;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 2px 4px var(--shadow) inset;
  }
}

.widget__link {
  color: var(--link);
  
  &:hover {
    text-decoration: none;
    color: var(--link-hover);
  }
}



// Layout
BODY {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  font: 16px/1.5 Trebuchet MS, Arial, sans-serif;
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.