Hi,
I have a wordpress site that I want to have center aligned and support different resolutions etc.
As you can see on the site (link), there's something wrong with my div backgrounds since they don't fill up the whole window.
What i want to achieve is (link) where you can change the window size and the whole page follows and stays centered, but the top background expands "infinitely" without affecting the rest of the page, scrollbars etc.
This is a codesnippet from the page:
and this is a part of the stylesheet:
From what I understand there's a problem with setting a fixed width (1002px) because that means it will crop the rest, but if I set it to something flexible, like 100% my margin: 0 auto doesn't seem to work and everything is stuck to the left...
I got it the size to work once, and it took up the whole window regardless of the browser size, but then when I reduced the window size and scrolled to the right the image was cropped according to the browser size.
So my scenarios are:
-Fixed width to 1002px, works with small window put 1002+ will crop
-100% width works with large window but small windows that require horizontal scroll will crop image to window size (go to (link), shrink window, scroll right and you see what I mean!).
How can I make the top background image fit both a small and a large window, where the background doesn't get cropped?
I have a wordpress site that I want to have center aligned and support different resolutions etc.
As you can see on the site (link), there's something wrong with my div backgrounds since they don't fill up the whole window.
What i want to achieve is (link) where you can change the window size and the whole page follows and stays centered, but the top background expands "infinitely" without affecting the rest of the page, scrollbars etc.
This is a codesnippet from the page:
Code:
<div id="superwrapper">
<div id="container">
<div id="wrapper">
<div id="header">
<?php.........
and this is a part of the stylesheet:
Code:
#superwrapper {
background:url(images/footer_bottom.png) repeat-x 0 100%;
position:relative;
}
#container {
margin: 0 0 0 10px;
}
#wrapper {
margin: 0 auto;
width:1002px;
}
#header {
width:1002px;
height:142px;
margin: 0 auto;
padding: 0 0 0 5px;
background:url(http://www.jfilund.se/images/logoheader.png) no-repeat; /*This is the top logo that gets cropped*/
z-index:-1;
}
From what I understand there's a problem with setting a fixed width (1002px) because that means it will crop the rest, but if I set it to something flexible, like 100% my margin: 0 auto doesn't seem to work and everything is stuck to the left...
I got it the size to work once, and it took up the whole window regardless of the browser size, but then when I reduced the window size and scrolled to the right the image was cropped according to the browser size.
So my scenarios are:
-Fixed width to 1002px, works with small window put 1002+ will crop
-100% width works with large window but small windows that require horizontal scroll will crop image to window size (go to (link), shrink window, scroll right and you see what I mean!).
How can I make the top background image fit both a small and a large window, where the background doesn't get cropped?