html - Stretching images when using as background image -


i trying set image background image django application. when set it, getting displayed tiled image. ie without stretching image, same image tiled , shown 4 times. can tell me how stretch image , set background image. paste code here. sure attribute must there setting this, couldnt find on googling.

<body bgcolor=" #408080" background="/static/paper.jpg" background-size: 100%; > 

you can stretch background 100% width , height putting image in <img> tag , give z-index of -1 acts background , behind else. works in browsers.

<img src="..." />  img{     position:absolute;     z-index:-1;     width:100%;     height:100%; } 

if not want break aspect ratio, set either width or height , not both.

check working example @ http://jsfiddle.net/uxbrm/1/


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -