I am trying to get my header's menu links looking closer to how I wish them to but am having trouble with centering...
At the moment I am using the list item tag and a left float for each link to line them horizontally. They are then put into some div tags with left 50% and -50% and such to center. How it is now I get a horizontal scroll-bar which grows as the menu links are added (cart and checkout). I have fiddled a bit but am only just getting my head around CSS and don't really know what exactly is going on.
The other thing I'm trying to do is have the "cart" and "checkout" links highlight in the same way the "shop" link does when you are on the appropriate page. I am not too fussed if I can't though.
This is the CSS for the menu I am using:
And this is the code from the Header PHP:Code:#menu { background-color: #191919; height: 45px; width: 850px; border: 0px; margin: 0 auto; } #center { float:left; position:relative; left:50%; text-align:left; } #menu ul { margin: 0 auto; padding: 0; bottom: 0; left: 0; position:relative; left:-50%; list-style: none; } #menu ul li { float:left;position:relative;/* ie needs position:relative here*/ } #menu .page_item a { padding: 0px 15px 0px 15px; line-height: 42px; color: #868686; text-decoration: none; font-size: 18px; font-family: Arial, Helvetica, sans-serif; text-align:center; white-space:nowrap; float:left } #menu .current_page_item a, #menu .page_item a:hover { color: #fff; }
Here is the live test site.Code:<!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper"> <!--bof-navigation display--> <div id="page"> <div id="menu"> <div id="center"> <ul> <li class="page_item"><a href="http://www.grandpastudios.com/v3html/home.html">home</a></li> <li class="page_item"><a href="http://www.grandpastudios.com/v3html/gallery.html">gallery</a></li> <li class="page_item"><a href="http://www.grandpastudios.com/blog">blog</a></li> <li class="page_item <?php if (($_GET[main_page]=='index') && ($_GET[cPath]=='')) { ?>current_page_item<?php } ?>"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?>shop</a></li> <li class="page_item"><a href="http://www.grandpastudios.com/v3html/contact.html">contact</a></li> <li class="page_item"><a href="http://www.grandpastudios.com/v3html/links.html">links</a></li> <?php if ($_SESSION['customer_id']) { ?> <li class="page_item"><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li> <li class="page_item"><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li> <?php } else { if (STORE_STATUS == '0') { ?> <li class="page_item"><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li> <?php } } ?> <?php if ($_SESSION['cart']->count_contents() != 0) { ?> <li class="page_item"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li> <li class="page_item"><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li> <?php }?> </ul> </div> </div> </div> <div class="navMainSearch forward"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?> <br class="clearBoth" /> </div> <!--eof-navigation display-->
If anyone has any ideas I would really appreciate them.
Thanks.





