Skip to content

Instantly share code, notes, and snippets.

@fribibb
Created April 4, 2016 06:19
Show Gist options
  • Save fribibb/1f95d773fc09537be2a747409bbdb916 to your computer and use it in GitHub Desktop.
Save fribibb/1f95d773fc09537be2a747409bbdb916 to your computer and use it in GitHub Desktop.
// Pretty broken images
//
// Based off:
// http://bitsofco.de/styling-broken-images/
img {
min-height: 50px;
font-family: 'Helvetica', sans-serif;
font-weight: 300;
line-height: 2;
text-align: center;
width: 100%;
height: auto;
display: block;
position: relative;
&:before {
// content: " ";
content: "We're sorry, the image below is broken :(";
display: block;
margin-bottom: 10px;
position: absolute;
top: -10px;
left: 0;
height: calc(100% + 10px);
width: 100%;
background-color: #e6e6e6;
border: 2px dotted #c8c8c8;
border-radius: 5px;
}
&:after {
font-style: normal;
font-family: FontAwesome;
position: absolute;
display: block;
font-size: 16px;
color: #636363;
z-index: 2;
width: 100%;
height: 100%;
background-color: #fff;
content: "" " Broken Image of " attr(alt);
top: 5px;
left: 0;
text-align: center;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment