CSS Question
- Started
- Last post
- 7 Responses
- pinkfloyd
I have a page set up with a fullscreen background image that scales fine with the browser. Then I have a floater image "bg_header.jpg" that's suppose to be centered. It worked fine at first until I gave it a link. Any way of fixing it?
- fadein110
what happened when you added the link?
- pinkfloyd0
The image "bg_header.jpg" stays on the top left of the page instead of being centered horizontally.
- bored2death0
It's got to be something with the way you're centering img.bg. I haven't seen "left" and "margin-left".
- pinkfloyd0
There's nothing wrong with img.bg, it's the background image that scales to the full height and width of the browser.
The probem is the other floating image "bg_header.jpg". It floated fine at the center of the screen, but as soon as I added a link to it, it stays stuck on the top left of the screen.
- melq0
Is that the code in totality? It sounds like there is a behavior assigned to <a> that is being added and causing a problem.
- Nicelydrawn0
Try setting your #page-wrap to have a margin of '0 auto;' That should center that div. Then you can make sure your img and/or <a> are positioned within it properly.
- pinkfloyd0
Awesome, it works now. Thanks Nicelydrawn
I added this line:
#page-wrap { position: relative; width: 478px; margin: 0 auto;}