centering content div in firefox

This is a discussion on "centering content div in firefox" within the Web Page Design section. This forum, and the thread "centering content div in firefox are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jun 28th, 2007, 16:04
New Member
Join Date: Jun 2007
Location: UK
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
centering content div in firefox

Hi

As pretty much a beginner, can anyone see why my content box at www.londonforager.com is stuck out on the left in Firefox when it's nicely centered in IE.

Stylesheet is here: www.londonforager.com/forager%20styles

Many thanks

Roland
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 28th, 2007, 16:13
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

I don't see anything in your code that tries to center it. You have a mixed code, a ton of unneeded css and lots of unwanted tables. This is a simple design and you have complicated it, so I'd suggest learning more about XHTML and CSS so that it is easier on you. You will be able to edit your code much easier.

But to center things, all you do is you put margin: 0 auto; in the item you want centered and viola, its centered in all browsers except IE. For IE you must use text-align: center; but make sure your content you re-align the text back to the way you want it to be displayed, so if you have a p element you do text-align: justified; there to get your content correct.

Hope that helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 28th, 2007, 16:25
New Member
Join Date: Jun 2007
Location: UK
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

yeah, learning more xhtml/css is definitely on my to do list, to be squeezed in somewhere between the day job and the pub.

in the meantime thanks for the tips, i'll have a play when i get home.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 28th, 2007, 16:26
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

Well I'd suggest learning at the pub . Nothing says cool like a beer and a laptop! lol.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 28th, 2007, 17:22
BGarner's Avatar
Reputable Member
Join Date: Oct 2006
Location: In front of the computer.
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

I would create a wrapper of the width you want your site and then put
Code: Select all
margin: 0 auto;
Then you can lay out your site within that wrapper so the whole site is centered.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 28th, 2007, 17:35
Reputable Member
Join Date: Jun 2007
Location: Bellevue, SK, Canada
Age: 29
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

Quote:
Originally Posted by JustinStudios View Post
Well I'd suggest learning at the pub . Nothing says cool like a beer and a laptop! lol.
LOL
I'll try that one time
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jun 28th, 2007, 17:46
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

To repeat what Justinstudios said:
Add to your div#content
this code
margin: 0 auto;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 28th, 2007, 20:48
New Member
Join Date: Jun 2007
Location: UK
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: centering content div in firefox

ha - brilliant! margin: 0 auto; did the trick.

many thanks to all!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
content, firefox, positioning

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash content resets, when style.display is used (prob in firefox, IE fine) call14 JavaScript Forum 13 Feb 28th, 2008 13:58
Why cant i view flash content in firefox? danny322 Flash & Multimedia Forum 13 Nov 28th, 2007 14:35
[SOLVED] Centering a horizontal list in Firefox masonbarge Web Page Design 6 Nov 19th, 2007 12:43
centering my content in IE (yet another problem) bengtec Web Page Design 7 Sep 26th, 2007 23:24
Content appears fine in Firefox and Netscape but not IE Lyss Web Page Design 3 Oct 11th, 2006 00:30


All times are GMT. The time now is 09:39.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42