thepitfall
03-22-2007, 03:10 AM
Hey guys, one last Q,
Trying to get the menu in this layout centralized. At the moment it seems to be left aligned.. I tried using the text-align: tag but to no avail.
If possible, centralized in IE and FF would be ideal. The code I am using is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dynamic Drive: CSS Fixed Layout #3.1- (Fixed-Fixed-Fixed)</title>
<style type="text/css">
body{
margin:0;
padding:0;
line-height: 1.5em;
background-color: #AC8367; /* f0e7d7 */
}
b{font-size: 110%;}
em{color: red;}
#maincontainer{
width: 840px; /*Width of main container*/
margin: 0 auto; /*Center container on page*/
margin-top: 20px;
}
#topsection{
background: #f0e7d7;
height: 190px; /*Height of top section*/
padding-top: 10px;
}
#topsection h1{
margin: 0;
padding-top: 15px;
}
#contentwrapper{
float: left;
width: 100%;
}
#contentcolumn{
margin: 0 190px 0 180px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/
background-color: #f7f2ea;
height: 700px;
}
#leftcolumn{
float: left;
width: 180px; /*Width of left column in pixel*/
margin-left: -840px; /*Set margin to that of -(MainContainerWidth)*/
height: 700px;
background: #f0e7d7;
}
#rightcolumn{
float: left;
width: 190px; /*Width of right column*/
margin-left: -190px; /*Set left margin to -(RightColumnWidth)*/
background: #f0e7d7;
height: 700px;
}
#footer{
clear: left;
width: 100%;
background: black;
color: #FFF;
text-align: center;
padding: 4px 0;
}
#footer a{
color: #FFFF80;
}
.innertube{
margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
margin-top: 0;
}
#navcontainer
{
background: #f0e7d7;
margin: 0 auto;
padding: 1em 0 0 0;
font-family: georgia, serif;
text-transform: lowercase;
text-align: center;
align: center;
}
/* to stretch the container div to contain floated list */
#navcontainer:after
{
content: ".";
display: block;
line-height: 1px;
font-size: 1px;
clear: both;
}
ul#navlist
{
list-style: none;
padding: 0;
margin: 0 auto;
width: 125%;
font-size: 0.8em;
}
ul#navlist li
{
display: block;
float: left;
width: 15%;
margin: 0;
padding: 0;
}
ul#navlist li a
{
display: block;
width: 100%;
padding: 0.5em;
border-width: 1px;
border-color: #ffe #aaab9c #ccc #fff;
border-style: solid;
color: #777;
text-decoration: none;
background: #f7f2ea;
}
#navcontainer>ul#navlist li a { width: auto; }
ul#navlist li#active a
{
background: #f0e7d7; /* active button colour */
color: #800000;
}
ul#navlist li a:hover, ul#navlist li#active a:hover
{
color: #800000;
background: transparent;
border-color: #aaab9c #fff #fff #ccc;
}
</style>
</head>
<body>
<div id="maincontainer">
<div id="topsection"><div class="innertube">
<img src="images/IDBannerFinal.jpg" />
<br>
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="#" id="current">Home</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
</ul>
</div>
</div></div>
<div id="contentwrapper">
<div id="contentcolumn">
<div class="innertube"><b>Content Column: <em>Fixed</em></b> <br>wewewee</div>
</div>
</div>
<div id="leftcolumn">
<div class="innertube"><b>Left Column: <em>180px</em></b>dsfdsdf</div>
</div>
<div id="rightcolumn">
<div class="innertube"><b>Right Column: <em>190px</em></b>dsfdsdf</div>
</div>
<div id="footer"><a href="http://www.dynamicdrive.com/style/">Dynamic Drive CSS Library</a></div>
</div>
</body>
</html>
Trying to get the menu in this layout centralized. At the moment it seems to be left aligned.. I tried using the text-align: tag but to no avail.
If possible, centralized in IE and FF would be ideal. The code I am using is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dynamic Drive: CSS Fixed Layout #3.1- (Fixed-Fixed-Fixed)</title>
<style type="text/css">
body{
margin:0;
padding:0;
line-height: 1.5em;
background-color: #AC8367; /* f0e7d7 */
}
b{font-size: 110%;}
em{color: red;}
#maincontainer{
width: 840px; /*Width of main container*/
margin: 0 auto; /*Center container on page*/
margin-top: 20px;
}
#topsection{
background: #f0e7d7;
height: 190px; /*Height of top section*/
padding-top: 10px;
}
#topsection h1{
margin: 0;
padding-top: 15px;
}
#contentwrapper{
float: left;
width: 100%;
}
#contentcolumn{
margin: 0 190px 0 180px; /*Margins for content column. Should be "0 RightColumnWidth 0 LeftColumnWidth*/
background-color: #f7f2ea;
height: 700px;
}
#leftcolumn{
float: left;
width: 180px; /*Width of left column in pixel*/
margin-left: -840px; /*Set margin to that of -(MainContainerWidth)*/
height: 700px;
background: #f0e7d7;
}
#rightcolumn{
float: left;
width: 190px; /*Width of right column*/
margin-left: -190px; /*Set left margin to -(RightColumnWidth)*/
background: #f0e7d7;
height: 700px;
}
#footer{
clear: left;
width: 100%;
background: black;
color: #FFF;
text-align: center;
padding: 4px 0;
}
#footer a{
color: #FFFF80;
}
.innertube{
margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
margin-top: 0;
}
#navcontainer
{
background: #f0e7d7;
margin: 0 auto;
padding: 1em 0 0 0;
font-family: georgia, serif;
text-transform: lowercase;
text-align: center;
align: center;
}
/* to stretch the container div to contain floated list */
#navcontainer:after
{
content: ".";
display: block;
line-height: 1px;
font-size: 1px;
clear: both;
}
ul#navlist
{
list-style: none;
padding: 0;
margin: 0 auto;
width: 125%;
font-size: 0.8em;
}
ul#navlist li
{
display: block;
float: left;
width: 15%;
margin: 0;
padding: 0;
}
ul#navlist li a
{
display: block;
width: 100%;
padding: 0.5em;
border-width: 1px;
border-color: #ffe #aaab9c #ccc #fff;
border-style: solid;
color: #777;
text-decoration: none;
background: #f7f2ea;
}
#navcontainer>ul#navlist li a { width: auto; }
ul#navlist li#active a
{
background: #f0e7d7; /* active button colour */
color: #800000;
}
ul#navlist li a:hover, ul#navlist li#active a:hover
{
color: #800000;
background: transparent;
border-color: #aaab9c #fff #fff #ccc;
}
</style>
</head>
<body>
<div id="maincontainer">
<div id="topsection"><div class="innertube">
<img src="images/IDBannerFinal.jpg" />
<br>
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="#" id="current">Home</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
</ul>
</div>
</div></div>
<div id="contentwrapper">
<div id="contentcolumn">
<div class="innertube"><b>Content Column: <em>Fixed</em></b> <br>wewewee</div>
</div>
</div>
<div id="leftcolumn">
<div class="innertube"><b>Left Column: <em>180px</em></b>dsfdsdf</div>
</div>
<div id="rightcolumn">
<div class="innertube"><b>Right Column: <em>190px</em></b>dsfdsdf</div>
</div>
<div id="footer"><a href="http://www.dynamicdrive.com/style/">Dynamic Drive CSS Library</a></div>
</div>
</body>
</html>