SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question Designing Mega Drop Down Menu- Unsure of HTML construction

    Hello everyone,

    I want to make a horizontal mega drop down menu. On the first tab, "health", I have skin care and weight loss pages, which I want to have 'weight loss' and 'skin care' bolded out as sub-sections inside the drop down. Weight loss has two sub-sections, 'fitness' and 'dieting'. I would like them to appear as headings to sub-sections. I'll illustrate this the best I can the way I want the 'health' tab to look.

    Health
    ---------Weight Loss
    -------------------------------Fitness
    Page #1, Page #2
    -------------------------------Dieting

    Page #1, Page #2
    ---------Skin Care
    ------------------Page #1, Page #2

    The health tab contains the deepest nesting. I have attempted to start my drop down menu with Sitepoint's Mega Drop Down Menu Tutorial and Sohtanaka's (Where I got The CSS and modeled my HTML after). Neither tutorial had as deep of nesting mine does. So that's where I'm confused.

    I need to know how to properly nest the Fitness and dieting sections so that they appear to be a category of its own.

    Here's what I've attempted:

    HTML:
    Code:
     <!-- begin Personal navigation menu -->
    <div class="pWrapper">
    <ul id="pMenu">
    	<li style="width:10%;"><a href="http://www.atlantareviewgroup.com/health.php" class="health">health</a>
        		<div class="pSub">
                <ul>
            		<h2>weight loss</h2>
                   		  <h3>fitness</h3>
                           		  <li><a href="#">under construction</a></li>
                        <h3>dieting</h3>
                           		  <li><a href="#">under construction</a></li>
       
                	<h2>skin care</h2>
                   		  <li><a href="#">under construction</a></li>
            	</ul>
    			</div>
        </li>    
    	<li style="width:14%;"><a href="http://www.atlantareviewgroup.com/insurance.php" class="insurance">insurance</a>
        		<div class="pSub">
            	<ul>
                	<h2>property insurance</h2>
                   		  <li><a href="#">under construction</a></li>
                	<h2>auto insurance</h2>
                   		  <li><a href="#">under construction</a></li>
                	<h2>health insurance</h2>
                   		  <li><a href="#">under construction</a></li>
                	<h2>annuities</h2>
                   		  <li><a href="#">under construction</a></li>
           	   </ul>
               </div>
       	   </li>
    
    	<li style="width:11.3%;"><a href="http://www.atlantareviewgroup.com/general.php" class="general">general</a>
        		<div class="pSub">
                <ul>
            		<h2>electronics</h2>
                   		  <li><a href="#">under construction</a></li>
                	<h2>style &amp; fashion</h2>
                   		  <li><a href="#">under construction</a></li>
                	<h2>food/dining</h2>
                   		  <li><a href="#">under construction</a></li>
                	<h2>cars/auto</h2>
                   		  <li><a href="#">under construction</a></li>
           		</ul>
                </div>
       	    </li>
    
    	<li style="width:10%;"><a href="http://www.atlantareviewgroup.com/dating.php" class="dating">dating</a>
        		<div class="pSub">
                <ul>
            		<li><a href="#">RealMatureSingles</a></li>
                	<li><a href="#">SeniorPeopleMeet</a></li>
            	</ul>
                </div>
        	</li>
    	
    	<li style="width:13.8%;"><a href="http://www.atlantareviewgroup.com/education.php" class="education">education</a>
        		<div class="pSub">
                <ul>
            		<li><a href="#">under construction</a></li>
            	</ul>
                </div>
        	</li>                    	
    </ul>
    	<!-- end Personal navigation menu-->
    The CSS from Sohtanaka website:
    Code:
    /********************/
    /*PERSONAL NAV MENU**/
    /********************/
    ul#pMenu li .pSub {
    	position: absolute; /*--Important--*/
    	top: 44px; left: 0;
    	z-index: 99999;
    	background: #344c00 url(sub_bg.png) repeat-x; /*--Background gradient--*/
    	padding: 20px 20px 20px;
    	float: left;
    	/*--Bottom right rounded corner--*/
    	-moz-border-radius-bottomright: 5px;
    	-khtml-border-radius-bottomright: 5px;
    	-webkit-border-bottom-right-radius: 5px;
    	/*--Bottom left rounded corner--*/
    	-moz-border-radius-bottomleft: 5px;
    	-khtml-border-radius-bottomleft: 5px;
    	-webkit-border-bottom-left-radius: 5px;
    	display: none; /*--Hidden for those with js turned off--*/
    }
    ul#pMenu li .row { /*--If needed to break out into rows--*/
    	clear: both;
    	float: left;
    	width: 100%;
    	margin-bottom: 10px;
    }
    ul#pMenu li .pSub ul{
    	list-style: none;
    	margin: 0; padding: 0;
    	width: 150px;
    	float: left;
    }
    ul#pMenu .pSub ul li {
    	width: 100%; /*--Override parent list item--*/
    	color: #fff;
    }
    ul#pMenu .pSub ul li h2 { /*--Sub nav heading style--*/
    	padding: 0;  margin: 0;
    	font-size: 1.3em;
    	font-weight: normal;
    }
    ul#pMenu .pSub ul li h2 a { /*--Sub nav heading link style--*/
    	padding: 5px 0;
    	background-image: none;
    	color: #e8e000;
    }
    ul#pMenu .pSub ul li a {
    	float: none;
    	text-indent: 0; /*--Override text-indent from parent list item--*/
    	height: auto; /*--Override height from parent list item--*/
    	background: url(navlist_arrow.png) no-repeat 5px 12px;
    	padding: 7px 5px 7px 15px;
    	display: block;
    	text-decoration: none;
    	color: #fff;
    }
    ul#pMenu .pSub ul li a:hover {
    	color: #ddd;
    	background-position: 5px 12px ;/*--Override background position--*/
    }
    /******************/
    /*End Personal Nav*/
    /*****************/

  2. #2
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)

  3. #3
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    You may have better luck with this code. I didn't nest the ul's to make it easier. http://www.visibilityinherit.com/cod...-drop-down.php


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •