Well, for example:
html:
HTML Code:
<html>
<body>
<div id="header"></div>
<div id="imagecontainer">
<img src="images/myImage.png"></img>
</div>
<div id="footer"></div>
</body>
</html>
css:
Code:
html, body {
height: 100%;
}
#imagecontainer {
height: 100%;
text-align: center;
}
img {
height: 100%;
width: auto;
}
#header {
position: absolute;
top: 0px;
width: 100%
height: 20px;
}
#footer {
position: absolute;
bottom: 0px;
width: 100%;
height: 20px;
}
This will stretch the image across the entire height, which is not what I want. I would really like it to leave some space on the top and bottom for my header and footer (while still stretching to fit the available space in the center). Any ideas?
Bookmarks