I’ve quickly made up a sliding doors example but I’m incorporating it into my header. The format of the header should be a fixed height header with a logo on the left and the sliding doors navigation buttons on the right. The background of the header should span the entire width of the browser, however the actual header (that is, the header logo and navigation on the right hand side) should be of a fixed width of roughly 900px and centred.
Any ideas on how to achieve this? I’ve tried the following:
<div id="header-outer">
<div id="header-container">
<a id="logo" href="<?php echo get_option('home'); ?>/"></a>
<div id="header-nav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
and the following CSS:
div#header-nav {
float:left;
width:100%;
background:rgb(33,33,33);
font-size:90%;
line-height:normal;
margin-top:90px;
}
div#header-nav ul {
margin:0;
padding:0;
list-style:none;
}
div#header-nav ul li {
float:left;
margin:0 2px 0 2px;
padding:0 0 0 4px;
background: url('images/tab_left.png') no-repeat left top;
}
div#header-nav a {
display:block;
background: url('images/tab_right.png') no-repeat right top;
padding:5px 10px 4px 6px;
text-decoration:none;
color:#333;
}
div#header-outer {
background: rgb(33,33,33);
height:100px;
display:block;
clear:both;
}
div#header-container {
text-align:center;
margin:0 auto;
width:900px;
padding:0;
}
just trying to understand your issue.
Do you want it to display like this…
Or like this…
If you’re after the first example then that should be quite easy with the following css…
#logo { float: left; /* floats logo to left */ } div#header-nav { float:right; /* had to remove width of 100% so nav can accept float */ background:rgb(33,33,33); font-size:90%; line-height:normal; margin-top:90px; } div#header-nav ul { margin:0; padding:0; list-style:none; } div#header-nav ul li { float:left; margin:0 2px 0 2px; padding:0 0 0 4px; background: url('http://kieransenior.co.uk/images/tab_left.png') no-repeat left top; } div#header-nav a { display:block; background: url('http://kieransenior.co.uk/images/tab_right.png') no-repeat right top; padding:5px 10px 4px 6px; text-decoration:none; color:#333; } div#header-outer { background: rgb(33,33,33); height:100px; display:block; clear:both; } div#header-container { text-align:center; margin:0 auto; width:900px; padding:0; }If you’d like it to display like the second example you might have to manually center both the logo and navigation as I’m not sure if it’s possible to so this with in CSS cross browser. But I could be wrong someoene feel free to correct me.
Hope it helps.