Quote component

by Federico Tibaldo

HTML

<div class="quote">

  <p class="quote__text">
    Empty inline elements generate empty inline boxes, but these boxes still have margins, padding, borders and a line height, and thus influence these calculations just like elements with content.
  </p>

  <a class="quote__source" href="https://drafts.csswg.org/css2/visudet.html#line-height" target="_blank">
    Source: CSS2 Editor’s draft, Section 10.8
  </a>

</div>

CSS

/* GENERAL */

@import url(//fonts.googleapis.com/css?family=Nunito);

body {
  line-height: 1.5;
  color: #333;
  font-family: 'Nunito', sans-serif;
}

a {
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

a[target="_blank"]::after {
  content: "\0020\2398";
}

/* QUOTE */

.quote {
  max-width: 480px;
  padding: 1.5rem;
  border-radius: 0.375rem;
  margin: 0 auto;
  box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.2);
}

.quote__text {
  margin: 0;
  margin-bottom: 1rem;
}

.quote__text::after,
.quote__text::before {
  content: '\201C';
  display: inline-block;
  padding: 0 0.5rem;
  font-size: 4rem;
  line-height: 0;
  color: #777;
}

.quote__text::before {
  vertical-align: bottom;
}

.quote__text::after {
  float: right;
  transform: rotateZ(180deg);
  vertical-align: top;
}

.quote__source {
  color: royalblue;
}