Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Created April 18, 2012 10:48
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 Chrisedmo/2412787 to your computer and use it in GitHub Desktop.
Save Chrisedmo/2412787 to your computer and use it in GitHub Desktop.
Placeholder Image Fetcher Function by: Anders Schmidt Hansen
.placeholder-500 {
display: block;
.placeholdit(500,300); // Magic!
.size(500,300);
}
// Call a Placehold.it image
.placeholdit(@width: 300, @height: 210) {
@placeholdIt: ~`"http://placehold.it/@{width}x@{height}"`;
background: url(@placeholdIt) no-repeat;
}
// Size Helper Function
.size(@width: 0, @height: 0) {
width: @width * 1px;
height: @height * 1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment