CSS3 Fill Background with Image

Using the CSS3 background size property to fill the background with an image. The image is scaled so that it’s smallest width or height fills the browser. View a demo here.

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>CSS3 Background Image Cover</title>
<style>
html {
	height: 100%;
}
body {
	background-image: url(background.png);
	-moz-background-size: cover;
	-o-background-size: cover;
	-webkit-background-size: cover;
	background-size: cover;
}
</style>
</head>

<body>
</body>
</html>

Links:
- Image Source
- -moz-background-size
- -webkit-background-size

This entry was posted in Uncategorized. Bookmark the permalink.