WordPress.org

Ready to get started?Download WordPress

Forums

theme with horizontal menus & submenus (1 post)

  1. pietimer
    Member
    Posted 5 years ago #

    Hey, does anyone know of any themes that have horizontal menus and submenus so that I can look at the code? I'm trying to build my own theme that has this, but the submenus look weird in IE7 (the submenus display inline with the menu). I'd link you to the site, but I don't have it published.

    If anyone is interested in trying to solve my problem here is my code

    header.php:

    <ul id="nav">
    		<?php wp_list_pages('title_li=&depth=1'); ?>
    		<?php if($post->post_parent)
    		$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
    		$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    		if ($children) { ?>
    			<ul id="subnav">
    				<?php echo $children; ?>
    			</ul>
    		<?php }?>
    	</ul>

    style.css

    #nav {
    	list-style: none;
    	padding: 0;
    	height: 34px;
    	font-size: 1em;
    	font-weight: bold;
    	text-transform: uppercase;
    	border-bottom: 4px solid #0288D8;
    	text-align:left;
    }
    
    #nav li {
    	float: left;
    	background: #CCE7F7 url(images/tableft.png) no-repeat left top;
    	padding: 8px 0 8px 14px;
    	margin-right: 1px;
    }
    
    #nav li a {
    	background: #CCE7F7 url(images/tabright.png) no-repeat top right;
    	padding: 8px 14px 8px 0;
    }
    #nav #subnav{
    	background:#0288d8;
    	float: left;
    	width: 100%;
    	padding: 3px 0 3px 0;
    
    }
    #nav #subnav li{
    	margin: 6px 0 5px 0;
    	background:#0288d8;
    	display: inline;
    	padding: 3px 0 3px 0;
    	border: 0;
    	border-right: dotted 2px
    }
    #nav #subnav li a{
    	margin-left:2px;
    	color:#FFF;
        background:#0288d8;
    }

    Thanks for any help!

Topic Closed

This topic has been closed to new replies.

About this Topic