joroco
10-23-2007, 09:34 PM
Hi,
I have a 100% width div and inside that I want to have buttons that are in the center of my page, the content below is 800-odd pixels and there is 3 columns in that. I have tried and tried to center it but it just doesn't want to happen. Can anyone help?
/* TOP PART OF THE WEBSITE */
#topheader {
background-color: blue;
width: auto;
}
#container {
width: 801px;
margin: 0 auto;
background-color: #cc223c;
}
#container ul {
list-style-type: none;
padding: 0;
display: inline;
text-align: center;
width: 60px;
}
#container a {
background-color: #3312aa;
float: left;
padding: 5px;
width: auto;
}
#container a:hover {
background-color: #667aaf;
color: #fff;
}
/* CONTENT GOES HERE */
#wrapper {
width: 801px;
margin: 0 auto;
background-color: #9affb3;
clear: both;
}
<div id="topheader">
<div id="container">
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
</ul>
</div>
</div>
I have a 100% width div and inside that I want to have buttons that are in the center of my page, the content below is 800-odd pixels and there is 3 columns in that. I have tried and tried to center it but it just doesn't want to happen. Can anyone help?
/* TOP PART OF THE WEBSITE */
#topheader {
background-color: blue;
width: auto;
}
#container {
width: 801px;
margin: 0 auto;
background-color: #cc223c;
}
#container ul {
list-style-type: none;
padding: 0;
display: inline;
text-align: center;
width: 60px;
}
#container a {
background-color: #3312aa;
float: left;
padding: 5px;
width: auto;
}
#container a:hover {
background-color: #667aaf;
color: #fff;
}
/* CONTENT GOES HERE */
#wrapper {
width: 801px;
margin: 0 auto;
background-color: #9affb3;
clear: both;
}
<div id="topheader">
<div id="container">
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 1</a></li>
</ul>
</div>
</div>