Given how you have the background images setup, it will be challenging to get that header centered as you desire.
Here is the CSS in question:
Code:
#frame_header { width: 100%; clear: both; margin: 0px auto }
.header_left { background: url('../images/template/header_left.png'); float: left }
.header_bg { background: url('../images/template/header_bg.png'); float: left; text-align: center; padding: 11px 0px 0px 0px }
.header_right { background: url('../images/template/header_right.png'); float: left }
The "margin: 0px auto" rule on the "frame_header" id won't center that item because it has a width of 100%. If the width was the exact width of the header background image, you might be able to get the header centered the way you want. The problem is since the background image will stretch to match the width of the text in the header, you won't necessarily know what the required width should be.
I also notice you aren't specifying any widths for the "header_left", "header_bg", or "header_right" classes yet all three are floated to the left. The CSS spec requires
floated elements to have a width specified. So, if I were you I would do this:
- Assign different color 1px borders to the "header_left", "header_bg", and "header_right" classes to see how those elements are laying out.
- Determine the appropriate width of the "header_left" and "header_right" elements (if possible) and specify those widths, accordingly.
- Determine the width of the header and set that width as the width of the "frame_header" id and then see if things start to center.
Now, you're violating a HTML rule by having more than one element with the same id. Each "frame_header" defined on the page now should have it's own id AND the "#frame_header" definition should be changed to a class definition. This way, you can specify the appropriate widths of each header as needed.
Alternatively, if the header text will be static, you can simply take screenshots of the current page and create static header images and use those instead of using dynamically sized headers.
So, one approach would be to get the width of the "frame_header" specified correctly so it can be centered. Here is an example of what I mean:
Code:
.frame_header { clear: both; margin: 0px auto }
.header_left { background: url('../images/template/header_left.png'); float: left width: 20px}
.header_bg { background: url('../images/template/header_bg.png'); float: left; text-align: center; padding: 11px 0px 0px 0px }
.header_right { background: url('../images/template/header_right.png'); float: left; width: 20px }
#frame_header1 { width: 200px; }
#frame_header2 { width: 100px; } Another approach is to simply make static images out of the headers, as they are displayed now, and use those instead of the dynamically sized header images.
The second approach would be simpler since you can center the header image and move on with your life.
I have NOT tried any of the above so I could be completely mistaken.
Peace...