<div class="container">
  <img src="http://bitsofco.de/broken.jpg" alt="Kanye Laughing" class="broken-3" />
</div>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  font-family: 'Helvetica';
  font-weight: 300;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  display: block;
  position: relative;
}


/* Style Three */

img.broken-3 {
  position: relative;
  min-height: 50px;
}

img.broken-3:before { 
  content: " ";
  display: block;

  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgb(235, 235, 235);
  border: 2px dotted rgb(200, 200, 200);
  border-radius: 5px;
}

img.broken-3:after { 
  content: "\f127" " Broken Image (" attr(alt) ")";
  display: block;
  font-size: 16px;
  font-family: FontAwesome;
  color: rgb(100, 100, 100);
  padding-top: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}






body {
  text-align: center;
}

.container {
  width: 100%;
  padding: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.