bluvertigo
4/2/2015 - 1:07 PM

Text over image / Testo sopra immagine - Fonte: http://codepen.io/chriscoyier/pen/myPMGB

Text over image / Testo sopra immagine - Fonte: http://codepen.io/chriscoyier/pen/myPMGB

@import url(http://fonts.googleapis.com/css?family=Roboto:400,900);

.module {
  background: 
    linear-gradient(
      rgba(0, 0, 0, 0.6),
      rgba(0, 0, 0, 0.6)
    ),
    url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/skyscrapers.jpg);
  background-size: cover;
  width: 300px;
  height: 200px;
  margin: 10px 0 0 10px;
  position: relative;
  float: left;
}

.top h2 {
  color: white;
  margin: 0;
  padding: 20px;
}

.lr p {
  font-family: 'Roboto', sans-serif;
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
  margin: 0;
}

.mid h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  color: white;
  text-transform: uppercase;
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 2rem;
  transform: translate(-50%, -50%);
}

.cap p {
  padding: 20px;
  color: white;
  font: 12px Monaco, Mono-Space;
  margin: 0;
}
<div class="module top">
  <h2>Skyscrapers</h2>
</div>

<div class="module mid">
  <h2>Skyscrapers</h2>
</div>

<br style="clear: both;">

<div class="module cap">
  <p>Skyscraper are really neat and stuff because they are tall.</p>
</div>

<div class="module lr">
  <p>Skyscrapers sometimes have nicknames like jim or shim.</p>
</div>