0

I have the following problem:

I have an image that goes through slides, I need that it is always resized to the size of the window and the monitor, I thought I'd use:

min-height: 100%; 
min-width: 1024px; 
width: 100%; 
height: auto; 

But does not solve my problem in the above image shows my current problem, I have a header DIV and a FOOTER DIV which is superimposed the image and the image is getting underneath the two divs eating pieces of it, how do I fix this?

An image to demo:

http://i46.tinypic.com/prqdl.jpg

2
  • try position:relative (or absolute) and setting z-index:1000 for example (in your css of course) Commented Jun 5, 2012 at 14:42
  • Added the css example for you Commented Jun 5, 2012 at 14:46

1 Answer 1

1
img {
    min-height: 100%; 
    min-width: 1024px; 
    width: 100%; 
    height: auto; 

    position:relative;
    z-index:1000;
}

That will make sure the image appears above everything

EDIT:

<div id="header"></div>
<div id="image">
    <img src="image_path">
</div>
<div id="footer"></div>

If that is your source, your css should look like this.

#header,#footer{
height:150px; // You set the number
width:100%;
}

#image{ /* The code you were using */
     min-height: 100%; 
     min-width: 1024px; 
     width: 100%; 
     height: auto;
}
Sign up to request clarification or add additional context in comments.

10 Comments

Thanks Nicolás! This code resolve 50% of my problem, now, the img is cuting only in the footer, an image to demo: i50.tinypic.com/2im0t8h.jpg
You have to add the same rules to everything that should be above. z-index places things in different "levels" if one could say so. So if you want the footer and header to be above the image just give the image a smaller z-index than the header and footer.
Actually, what I need is that the image is always set at the ends of the header and footer, regardless of the display or resolution, as it is a photo site ... the problem is not only the image of 'eat' a piece
I understand now, I added a little example to see if it helps you
Very thanks to help me! But is not work, the div image not resize according the footer, its my div footer: #footer-container {height:85px;display:block;background:#0a0a0a url(images/bg-footer.png) repeat-x left top;clear:both;position:fixed;bottom:0px;z-index:100;width:100%;} #footer {display:block;margin:0 auto;width:950px;overflow:hidden;}
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.