Css automatic placement

Acer / Aspire 5745g
February 13, 2011 at 04:05:39
Specs: Windows 7 x64, 1.6 GHz / 4030 MB
Hi I have this code for a menu that stays on top of the page all the time independent of scroll, but it's too small. I use wordpress if that's any help and this 'banner' menu is placed as a div in header.php, just after </header>.
Here's the code:

div.banner {
display: block;
z-index: 1;
margin: 0;
font-size: 100% /*adjust to make the menu larger or smaller*/;
font-weight: bold;
line-height: 38px;
text-align: center;
position: fixed;
top: 0em;
left: auto;
width: 940px;
right: auto;
background: #000;
-khtml-opacity: 0.8;
opacity: 0.8;

div.banner p {
margin: 0;
padding: 0.3em 0.4em;
font-family: Arial, sans-serif;
background: #000;
border: thin outset #000;
color: #fff;

div.banner:hover {
-moz-opacity: 1.0;
-khtml-opacity: 1.0;
opacity: 1.0;

div.banner a, div.banner em { margin: 0 0em }
div.banner a, div.banner em { padding: 0px 10px; }
div.banner a:first-child { border-top: none }
div.banner em { color: #CFC }

div.banner a:link { text-decoration: none; color: white }
div.banner a:visited { text-decoration: none; color: #CCC }
div.banner a:hover { background: black; color: white }

I don't know if you can test it out but the problem is that I want it stretching from the far left and fill out the whole page on width. Though I still want the buttons, passed to it with
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
, to be located where they are now.

Edit. I can make it fill up with width: 100%; and left: 0; but the buttons follows it out to the left, I want to prevent this.
Live the life as you know it
/ Wille

See More: Css automatic placement

Report •

February 13, 2011 at 08:34:24
Never mind, I fixed it with margin-left: auto; it just wasn't where I expected and therefore it didn't work at first.

Live the life as you know it
/ Wille

Report •
Related Solutions

Ask Question