Sunday, June 10, 2012

CSS: full screen background

Use background-size property, for example:

body{
padding:0px;
margin:0px;
position: relative;
height: 100%;
width: 100%;
background-image:url('images/background.png');
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
font-family: arial,helvetica,sans-serif;
}

1 comment:

Subscribe to RSS Feed Follow me on Twitter!