Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Firefox DIV won't center
Old 12-06-2008, 09:47 AM Firefox DIV won't center
Junior Talker

Posts: 2
Name: pksml
Location: Ohio, USA
Trades: 0
Hello fellow webmasters.

I have recently redesigned my website using a new template. The site works just fine in IE7, but the main page content is not being centered in FF 3.

You see in the image below I have firebug open. That specific DIV (class=the_body) has an absolute width set and the text-align is set to center. Why then is Firefox not centering the div?

Thanks for any help!

You can see the page (I saved it with all CSS embedded) at www.pksml.net/weather.htm


pksml is offline
Reply With Quote
View Public Profile Visit pksml's homepage!
 
 
Register now for full access!
Old 12-06-2008, 10:26 AM Re: Firefox DIV won't center
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
That specific DIV (class=the_body) has an absolute width set and the text-align is set to center. Why then is Firefox not centering the div?
It's not centered because that is not the right way to center a div. The text-align:center centers the text INSIDE the div - not the div itself. If you want the div centered - add margin: 0 auto; (adjust top and bottom as needed).
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-06-2008, 10:58 AM Re: Firefox DIV won't center
Junior Talker

Posts: 2
Name: pksml
Location: Ohio, USA
Trades: 0
Thank you so much ladynred! That did the trick, as you can see at www.pksml.net/weather

I've googled this issue many times, but never found that fix. It's been the reason for many a headache!

I also plan on reading the web standards cirriculum you recommended.

Thanks again!
pksml is offline
Reply With Quote
View Public Profile Visit pksml's homepage!
 
Old 12-06-2008, 07:33 PM Re: Firefox DIV won't center
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You should also check out the stickies at the top of each of our forum areas.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-08-2008, 02:16 AM Re: Firefox DIV won't center
Banned

Posts: 12
Trades: 0
Did you add margin: 0 auto; ? I still see the div being positioned to the left inside your content area.
CSSKid is offline
Reply With Quote
View Public Profile
 
Old 12-08-2008, 05:25 PM Re: Firefox DIV won't center
Skilled Talker

Posts: 52
Name: Morten
Trades: 0
<div class="the_body" align="center" style="width: 700px;">

Maybe?
__________________
- Do Nothing!
- Get Nothing!

Please login or register to view this content. Registration is FREE
Rotco88 is offline
Reply With Quote
View Public Profile
 
Old 12-08-2008, 08:19 PM Re: Firefox DIV won't center
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Nope, READ THE STICKIES!
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-08-2008, 08:28 PM Re: Firefox DIV won't center
Experienced Talker

Posts: 41
Name: Crystal
Location: Beverly Hills
Trades: 0
margin: 0 auto;
__________________
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

majormusic is offline
Reply With Quote
View Public Profile Visit majormusic's homepage!
 
Reply     « Reply to Firefox DIV won't center
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53454 seconds with 12 queries