Skip to content

Instantly share code, notes, and snippets.

@ddprrt
Created January 30, 2012 15:05
Show Gist options
  • Save ddprrt/1704873 to your computer and use it in GitHub Desktop.
Save ddprrt/1704873 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
#bg {
position:fixed;
top:-50%;
left:-50%;
width:200%;
height:200%;
}
#bg img {
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:auto;
min-width:50%;
min-height:50%;
}
<!-- content to be placed inside <body>…</body> -->
<div id="bg">
<img src="http://www.silhouette.com/_media/img/home/bild_gross_1600x1080px.jpg" />
</div>
{"view":"separate","prefixfree":"1","page":"result"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment