Link to home
Start Free TrialLog in
Avatar of CFbubu
CFbubu

asked on

Div alignment centering

Hi Guys,

I am not sure why I am still having difficulty trying to get a 1000px div to center on a page.

In fact, it's exactly how the navigation banner or footer works on this experts exchange website.

The 'center' div with width 1000px will remain centered on the page but the background extends all the way to the end on each side.

Thanks again for your kind help.
SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So is the question about centering (as Chris has answered above) or about how to have the background extend?
Avatar of CFbubu
CFbubu

ASKER

Hi,

Thanks for your quick reply. Unfortunately, when I used your code, I do get a blue block centered, but the sides do not extend to the edges of the screen...(See picture below)

User generated image
What I trying to do is like how the navigation bar header and footer works on this website. That is the content stays centered but the background extends all the way to the side edges.(See pciture below)

User generated image
Thanks again!
Avatar of CFbubu

ASKER

Hey GaryC123,

Good morning to you! Nice to see you around :)

No...unfortunately, the solution submitted by Chris did not work. :(
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sheesh Chris is on the ball - didn't even have time to read the response!
Avatar of CFbubu

ASKER

I am sorry Chris. Let me check the code again and get back to you.

I do appreciate your help.
Here it is in operation, so I know my code works :)

http://jsfiddle.net/ChrisStanyon/78v9z/
Avatar of CFbubu

ASKER

you are right...its something on my page that is messing it up....sorry. I am still trying to figure out what's causing it.

Thanks for jumping in so quick to help me .