Skip to content

Instantly share code, notes, and snippets.

@codedcontainer
Created March 10, 2016 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codedcontainer/c47a089987b29c0c6743 to your computer and use it in GitHub Desktop.
Save codedcontainer/c47a089987b29c0c6743 to your computer and use it in GitHub Desktop.
Broken image placeholder design
img {
/* Same as first example */
min-height: 50px;
}
img:before {
content: " ";
display: block;
position: absolute;
top: -10px;
left: 0;
height: calc(100% + 10px);
width: 100%;
background-color: rgb(230, 230, 230);
border: 2px dotted rgb(200, 200, 200);
border-radius: 5px;
}
img:after {
content: "\f127" " Broken Image of " attr(alt);
display: block;
font-size: 16px;
font-style: normal;
font-family: FontAwesome;
color: rgb(100, 100, 100);
position: absolute;
top: 5px;
left: 0;
width: 100%;
text-align: center;
}
@codedcontainer
Copy link
Author

This has been copied from the following location:

http://bitsofco.de/styling-broken-images/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment