Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / May 2005



Tip: Looking for answers? Try searching our database.

center align a <div> element

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bissatch@yahoo.co.uk - 30 May 2005 01:58 GMT
Hi,

I have the following page:

www.martynbissett.co.uk/index_div.html

It is very basic that all elements will be structured using <div> tags
and CSS styles will define the layout. What I dont know how to do is
align the wrapper <div> (#maindiv) center. How is this done?

Cheers

Burnsy
logic_earth - 30 May 2005 08:44 GMT
body {
margin: 0;
text-align: center; /* IE5 workaround */
}

#maindiv {
background-color: #eee;
width: 750px;
margin: 0 auto;
text-align: left;
}
logic_earth - 30 May 2005 08:51 GMT
i forgot to post a reference.

http://www.google.com/search?q=css+centering
http://www.simplebits.com/notebook/2004/09/08/centering.html
Jim Moe - 30 May 2005 08:57 GMT
> It is very basic that all elements will be structured using <div> tags
> and CSS styles will define the layout. What I dont know how to do is
> align the wrapper <div> (#maindiv) center. How is this done?

  margin-left:  auto;
  margin-right: auto;

Signature

jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.