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.
|
|
|
|
|
![]() |
||
centering content div in firefox
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
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 |
|
|
|
#2
|
||||
|
||||
|
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.
Last Blog Entry: Happy Holidays - A Non Offensive way to say Merry Christmas? WRONG! (Dec 11th, 2007)
|
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
Re: centering content div in firefox
Well I'd suggest learning at the pub
Last Blog Entry: Happy Holidays - A Non Offensive way to say Merry Christmas? WRONG! (Dec 11th, 2007)
|
|
#5
|
||||
|
||||
|
Re: centering content div in firefox
I would create a wrapper of the width you want your site and then put
|
|
#6
|
|||
|
|||
|
Re: centering content div in firefox
Quote:
I'll try that one time |
|
#7
|
|||
|
|||
|
Re: centering content div in firefox
To repeat what Justinstudios said:
Add to your div#content this code margin: 0 auto; |
|
#8
|
|||
|
|||
|
Re: centering content div in firefox
ha - brilliant! margin: 0 auto; did the trick.
many thanks to all! |
![]() |
| Tags |
| content, firefox, positioning |
| Thread Tools | |
|
|
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 |