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;
display:block;
padding:0 !important;
margin:0;
On 100% zoom this is OK. but when I zoom in at 180% approx, the image will be short from top and bottom, I want some css tricks.
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 forX
AS WELL ASY
, you are setting100%
just for theX
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 forbackground-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, usingcover
will crop your image.Set Responsive and User friendly Background
Check this out,
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
css:
Try this:
For full image background, check this: