| Author |
center align a <div> element
|
|
| bissatch@yahoo.co.uk 2005-05-29, 11:24 pm |
| 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 2005-05-30, 4:30 am |
| body {
margin: 0;
text-align: center; /* IE5 workaround */
}
#maindiv {
background-color: #eee;
width: 750px;
margin: 0 auto;
text-align: left;
}
| |
|
|
| Jim Moe 2005-05-30, 7:56 am |
| bissatch@yahoo.co.uk wrote:
>
> 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;
--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |