wizard210
01-18-2005, 07:15 PM
I have a css template I'm working on. It may not be the greatest but It is something I like. I tried to recreate the layout like on the site "alistapart" minus the right column. On my navigation I'm stumped on how to center the links across the page. Plus to make them spread out a little bit. Could someone help me out. Or at least explain the concept to me.
<html>
<head>
<title>Horizontal Menu</title>
</head>
<style>
body{
background-color: #cccccc;
}
#page{
margin-top: 5px;
margin-right: auto;
margin-left: auto;
border: 1px solid;
background-color: white;
width: 70%;
}
#head{
padding: 0px;
background-color: red;
border-bottom: 1px solid;
border-top: 1px solid;
}
#main{
text-align: left;
color: black;
background-color: yellow;
border-bottom: 1px solid;
}
#footer{
background-color: blue;
border-top: 1px solid;
border-bottom: 1px solid;
}
#nav ul{
padding : 0;
margin : 0;
white-space : nowrap;
background-color : #003399;
color : White;
float : left;
width : 100%;
border-style : solid;
border-color : #0066CC;
border-width : 2px 0 2px 0;
}
#nav ul li{
display : inline;
}
#nav ul li a{
padding-left : 1em;
background-color : #003399;
color : White;
font-weight : bold;
text-decoration : none;
border-right-color : #0066CC;
border-right-style : solid;
border-right-width : 1px;
}
#nav ul li a:hover{
background-color : #99CCFF;
color : #000066;
}
</style>
<body>
<div id="page">
<div id="head">
<h2>Header</h2>
</div>
<div id="nav">
<ul>
<li><a href=>Link 1</a></li>
<li><a href=>Link 2</a></li>
<li><a href=>Link 3</a></li>
<li><a href=>Link 4</a></li>
</ul>
</div>
<div id="main">
<p>content</p>
<p>content</p>
<p>content</p>
</div>
<div id="footer">
<p>content</p>
</div>
</div>
</body>
</html>
<html>
<head>
<title>Horizontal Menu</title>
</head>
<style>
body{
background-color: #cccccc;
}
#page{
margin-top: 5px;
margin-right: auto;
margin-left: auto;
border: 1px solid;
background-color: white;
width: 70%;
}
#head{
padding: 0px;
background-color: red;
border-bottom: 1px solid;
border-top: 1px solid;
}
#main{
text-align: left;
color: black;
background-color: yellow;
border-bottom: 1px solid;
}
#footer{
background-color: blue;
border-top: 1px solid;
border-bottom: 1px solid;
}
#nav ul{
padding : 0;
margin : 0;
white-space : nowrap;
background-color : #003399;
color : White;
float : left;
width : 100%;
border-style : solid;
border-color : #0066CC;
border-width : 2px 0 2px 0;
}
#nav ul li{
display : inline;
}
#nav ul li a{
padding-left : 1em;
background-color : #003399;
color : White;
font-weight : bold;
text-decoration : none;
border-right-color : #0066CC;
border-right-style : solid;
border-right-width : 1px;
}
#nav ul li a:hover{
background-color : #99CCFF;
color : #000066;
}
</style>
<body>
<div id="page">
<div id="head">
<h2>Header</h2>
</div>
<div id="nav">
<ul>
<li><a href=>Link 1</a></li>
<li><a href=>Link 2</a></li>
<li><a href=>Link 3</a></li>
<li><a href=>Link 4</a></li>
</ul>
</div>
<div id="main">
<p>content</p>
<p>content</p>
<p>content</p>
</div>
<div id="footer">
<p>content</p>
</div>
</div>
</body>
</html>