Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Design Forum > HTML / CSS
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-26-2008, 01:22 PM   #1 (permalink)
labiere
Junior Member
 
Join Date: May 2008
Posts: 5
Default Div within Div not centering Firefox and I'm using margin: 0 auto

Hi there. Ran into this issue with centering a div within a wrapper div. The child div is not centering in relation to the parent div in Firefox 2.

My Google searches on this problem have revealed solutions that look similar to this:

Code:
div#wrapperdiv { text-align: center; } div#div_to_be_centered { text-align: left; margin: 0 auto; width: 650px; }

Now when I apply this idea to my own site I am not getting the desired effect. IE7 is centering the child since I think it is reacting to the text-align: center; code in the parent div. But FF is not centering the inner div. Here is my code:

Code:
.outer-div { width: 558px; background-color:#9999FF; text-align: center; } .inner-div { margin 0 auto 0 auto; width: 380px; background-color: #009900; border-color: #00ff00; border: 2px solid; font-family:Arial, Helvetica, sans-serif; font-size: 14px; color: #00ff00; padding: 40 0 20 0; }

I'm stumped, but thinking it may have to do with my outer-div being further wrapped inside a floating div, which is inside an even larger div.. Can this nesting of divs be the issue?
labiere is offline   Reply With Quote
Sponsored Links
Old 05-26-2008, 01:46 PM   #2 (permalink)
labiere
Junior Member
 
Join Date: May 2008
Posts: 5
Default Re: Div within Div not centering Firefox and I'm using margin: 0 auto

Here is the problem on a live site:

Raise The Stakes For Success

The green box in the right-column is the problem div.
labiere is offline   Reply With Quote
Old 05-26-2008, 02:07 PM   #3 (permalink)
labiere
Junior Member
 
Join Date: May 2008
Posts: 5
Default Re: Div within Div not centering Firefox and I'm using margin: 0 auto

Syntax error. Colon missing in margin declaration.
labiere is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 10:50 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums