- Joined
- Sep 1, 2007
- Sythe Gold
- 690
- Messages
- 6,681
(Sorry about the annoying format, makes the text easier to see next to all the screenshots)
Ok so I'm a HUGE noob when it comes to web dev, I've only just started learning. I've got the following code:
Ok so I'm a HUGE noob when it comes to web dev, I've only just started learning. I've got the following code:
Code:
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
min-height: 100%
}
body {
background-color: #ffffff;
background-image: url(banner.png), url(footer.png), url(filler.png);
background-position: center top, center bottom, center center;
background-repeat: no-repeat, no-repeat, repeat-y;
}
</style>
</head>
<body>
<style>
div.content {
width:700px;
padding:10px;
border:2px solid #004688;
margin:auto;
margin-top:400px;
margin-bottom: 135px;
}
</style>
<div class="content">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test</div>
</body>
</html>
And here is the result:
Looks good, everything is aligned properly. But then when the page is resized to a size smaller than the div container, the div and the background fall out of alignment. Here's what it looks like:
.......
How do I make it so that the div stays aligned relative to the background image? OR How do I make the background image stop at the left-most edge when resizing, so it stays center until the window is too small for it? The background image ends at the very end of the shadow graphic, the white in the background is just a background-color property.
Looks good, everything is aligned properly. But then when the page is resized to a size smaller than the div container, the div and the background fall out of alignment. Here's what it looks like:
How do I make it so that the div stays aligned relative to the background image? OR How do I make the background image stop at the left-most edge when resizing, so it stays center until the window is too small for it? The background image ends at the very end of the shadow graphic, the white in the background is just a background-color property.










