HighDots Forums  

centering a div tag using css

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss centering a div tag using css in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ian2003
 
Posts: n/a

Default centering a div tag using css - 12-01-2005 , 10:34 AM






i wish to center a div tag on a page horizontaly , it remains the same size box in the centre of the page but remains central no matter how i expand the browser left and right!

thanks

Reply With Quote
  #2  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: centering a div tag using css - 12-01-2005 , 10:47 AM






<div style="width:400px; margin:0 auto;">This will remain centered</div>

If you want to accommodate IE5+ browsers, you will need to add -

body { text-align:center; }

to your CSS, and then set it back to left align in your page's container -
whatever that is.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"ian2003" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
i wish to center a div tag on a page horizontaly , it remains the same
size box in the centre of the page but remains central no matter how i
expand the browser left and right!

thanks



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.