HighDots Forums  

Make Firefox Center Content in a div Or td Tag By Using CSS?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Make Firefox Center Content in a div Or td Tag By Using CSS? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
joey.powell@topscene.com
 
Posts: n/a

Default Make Firefox Center Content in a div Or td Tag By Using CSS? - 08-05-2005 , 12:20 PM






Make Firefox Center Content in a div Or td Tag By Using CSS?

Does anyone know how to do this. IE works great with text-align:center;
but Firefox just always left-aligns...


Reply With Quote
  #2  
Old   
Els
 
Posts: n/a

Default Re: Make Firefox Center Content in a div Or td Tag By Using CSS? - 08-05-2005 , 12:34 PM






joey.powell (AT) topscene (DOT) com wrote:

Quote:
Make Firefox Center Content in a div Or td Tag By Using CSS?

Does anyone know how to do this. IE works great with text-align:center;
but Firefox just always left-aligns...
If you'd use a valid doctype, IE6 wouldn't do it either.
text-align:center only works on inline content.

To center block-level elements, you need to set the left and right
margin to identical values.

For instance:
<div class="outer">
<div class="inner">
some content
</div>
</div>

To center div.inner inside div.outer, you can use:
div.inner{width:[some value];margin:auto;}
or
div.inner{width:auto;margin:[some value];}

(Note: width:auto; is superfluous on a div, unless you've set a width
on divs earlier in the stylesheet, which you need to 'undo' by setting
it to the default 'auto'.)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: D.A.D. - Bad Craziness


Reply With Quote
  #3  
Old   
David Dorward
 
Posts: n/a

Default Re: Make Firefox Center Content in a div Or td Tag By Using CSS? - 08-05-2005 , 07:08 PM



joey.powell (AT) topscene (DOT) com wrote:

Quote:
Make Firefox Center Content in a div Or td Tag By Using CSS?
http://dorward.me.uk/www/centre/

Quote:
Does anyone know how to do this. IE works great with text-align:center;
Since the spec says that it shouldn't act in that way, its hardly "great".

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
Reply




Thread Tools
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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.