Stretching background of the div

I need to stretch image inside div element.

So on the site: http://fishcacher.sytes.net/ there is background image

for "fc-container" div element:

.fc-container {
    background-image:url('../images/bg_1400.png'); 
    background-repeat:no-repeat;  
    margin:0px; 
    background-size: cover;
}

I need it works exactly like this http://www.htmlite.com/faqEX004.html , but inside my "fc-container" div element. Currently a lot of image is hidden below the bottom bar.

I tried different ways but can't fix that.

Appreciate any help. Thanks a lot!

Answers


On the your example site, they haven't used CSS alone to create their background, they've used a wrapper that contains a image that is then stretched to fill the whole screen. Here's the required HTML code:

<div class="backgroundimagewrapper">
    <img class="backgroundimage" src="http://fishcacher.sytes.net/images/bg_1200.png" />
</div>

And here's the CSS

.backgroundimagewrapper{
    position: absolute; /* So we can position our div precisely */
    left: 0; /* Move it to the top-left */
    top: 0;
    z-index: -100; /* Make it appear behind other elements */
    padding: 0; /* Make sure we don't have any white space around the edges */
    margin: 0;
    width: 100%; /* Make it fill our whole screen */
    height: 100%;
}
.backgroundimage{
    width: 100%; /* Make the image fill the whole div */
    height: 100%;
 }

That's how they've done it on the website you've linked. Anyway, here's a JSFiddle with the code: http://jsfiddle.net/T2t5m/5/


add these styles to your fc-container

position:fixed; top:0; left:0; width:100%; height:100%;

Need Your Help

gnuplot bar graph not working

graph plot gnuplot

plot data_file using 1:2 with box fs solid title ""

Fitting data to system of ODEs using Python via Scipy & Numpy

python numpy scipy differential-equations data-fitting

I am having some trouble translating my MATLAB code into Python via Scipy &amp; Numpy. I am stuck on how to find optimal parameter values (k0 and k1) for my system of ODEs to fit to my ten observed...