Created
May 18, 2011 16:40
-
-
Save TheDahv/978963 to your computer and use it in GitHub Desktop.
Scalable background image on a site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Scalable Image Test</title> | |
<style type="text/css"> | |
body { | |
/* Background image rules */ | |
background-attachment: fixed; | |
background-color: #333; | |
background-image: url(../img/bgimg.png); | |
background-position: top right; | |
background-repeat: no-repeat; | |
margin: 0; | |
padding: 0; | |
background-size: 30% auto; | |
-moz-background-size: 30% auto; | |
-webkit-background-size: 30% auto; | |
} | |
body { | |
text-align: center; | |
} | |
section { | |
margin: 0 auto; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Scalable Image Test</h1> | |
<section> | |
<p>Hi. This is where we are going to test scalable background images</p> | |
</section> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment