I dont want to use html tag. This is my css. I am using bootstrap 3.0.
background:url(\'images/ip-box.png\')no-repeat;
background-size:100%;
height: 140px;
For full image background, check this:
html {
background: url(images/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Check this out,
body {
background-color: black;
background: url(img/bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
I found this:
Full
An easy to use, full page image background template for Bootstrap 3 websites
http://startbootstrap.com/template-overviews/full/
or
using in your main div container:
html
<div class="container-fluid full">
</div>
css:
.full {
background: url('http://placehold.it/1920x1080') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
height:100%;
}
Set Responsive and User friendly Background
<style>
body {
background: url(image.jpg);
background-size:100%;
background-repeat: no-repeat;
width: 100%;
}
</style>
Try this:
body {
background-image:url(img/background.jpg);
background-repeat: no-repeat;
min-height: 679px;
background-size: cover;
}
You need to use background-size: 100% 100%;
Demo
Demo 2 (Won't stretch, this is what you are doing)
Explanation: You need to use 100% 100%
as it sets for X
AS WELL AS Y
, you are setting 100%
just for the X
parameter, thus the background doesn't stretch vertically.
Still, the image will stretch out, it won't be responsive, if you want to stretch the background
proportionately, you can look for background-size: cover;
but IE will create trouble for you here as it's CSS3 property, but yes, you can use CSS3 Pie as a polyfill. Also, using cover
will crop your image.