Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Feb 2013
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts

    HTML & CSS Menu Menu

    I want to create a mega menu, for 1 of the items in my menu list.

    Current Menu: http://jsfiddle.net/ngrDL/

    Mega Menu: http://jsfiddle.net/Pnn6V/3/

    Refer to the Mega Menu "4 Columns". I want to make my current menu item "Projects" like the 4 columns menu, in the mega menu. So it has that big drop down underneath it. With 4 columns of various links

    Can anyone help me do this?

    Thanks.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello KKHAN,
    I'm not sure what kind of help you want since you provide a decent example to follow already.

    You should fix the menu you've got first. I would want to consolidate that CSS and validate everything before adding more to it.

    You have a bit of divitis I think. Hard to say what's going on with .topMenu and #cssmenu later in development but one of those really doesn't add anything to the menu right now...

    Validating will help find errors like your misspelling of backgroiund.

    I'm not sure why you add #One:hover to each bit that puts your 4px border on the bottom of each li that's hovered?

    Things like min-height: 1px;, that * in front of display, using the > to target your anchors, padding: 0 auto; ?, putting margin: 0 auto; on an element with no width, using :after to clear something that doesn't need cleared, multiple entries in your CSS for styling the same element... all these things just add to confusion later on.

    ...

    Once you get all that fixed to your liking, I would just suggest editing your markup to add the dropped mega-menu by following the example you link to.
    Then you'd probably want to remove the :hover 4px bottom border from the parent li.
    Then your biggest task would be specificity. You'll want to target the mega-menu ul/li's without messing up the parent menu.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Feb 2013
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I want you to change my menu for me, to have that mega menu on the project item. So i can learn of it later. Unfortunately the example i provided im struggling to integrateit into mine.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Let's have a look at the most recent version of your code where you attempt to add the mega-menu yourself.

    I would still recommend cleaning up the menu you have now, before you add more to it.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    New Coder
    Join Date
    Feb 2013
    Posts
    31
    Thanks
    2
    Thanked 0 Times in 0 Posts
    If you could do me a great favor by cleaning up what i have atm, by commenting the bits i have added which is not needed. This will help me learn the bits i dont need. as im new to css and this is the best way i learn.

    Please have a look at the updated version.

    http://jsfiddle.net/ngrDL/2/

    the topmenu holds the cssmenu inside. the topmenu has autowidth so it spands the page of the browser, where as i have fixed cssmenu to 1024px and put it in the middle.
    Last edited by KKHAN; 03-22-2013 at 08:13 PM.

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    It's looking better. At least you have a reason for those two containing elements but I still think you can do away with one by styling the #cssmenu ul instead.

    Have a look at some cleanup I did earlier -
    Code:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	height: 100%;
    	margin: 0;
    	background: #fc6;
    	font: 100% "Oxygen Mono", Tahoma, Arial, sans-serif;
    	color: #000;
    }
    body {overflow-y: scroll;}
    #topMenu {
    	width: 1024px;
    	margin: 30px auto;
    	background: #fff;
    	border-bottom: 4px solid #ff9;
    }
    ul#cssmenu {
    	margin: 0;
    	padding: 0;
    	list-style: none;
    	font-size: 11px;
    	text-align: center;
    }
    	ul#cssmenu li {
    		display: inline-block;
    		border-bottom: 4px solid #fff;
    	}
    		#cssmenu a {
    			line-height: 50px;
    			padding: 0 20px;
    			display: block;
    			text-decoration: none;
    			color: #333D45;
    			text-transform: uppercase;
    		}
    			ul#cssmenu li#One:hover {border-bottom: 4px solid #f00;}
    			ul#cssmenu li#Two:hover {border-bottom: 4px solid #0f0;}
    			ul#cssmenu li#Three:hover {border-bottom: 4px solid #00f;}
    			ul#cssmenu li#Four:hover {border-bottom: 4px solid #ff0;}
    			ul#cssmenu li#Five:hover {border-bottom: 4px solid #0ff;}
    			ul#cssmenu li#Six:hover {border-bottom: 4px solid #f0f;}
    			ul#cssmenu li#Seven:hover {border-bottom: 4px solid #000;}
    			ul#cssmenu li#Eight:hover {border-bottom: 4px solid #63f;}
    			ul#cssmenu li#Nine:hover {border-bottom: 4px solid #c30;}
    			ul#cssmenu li#Ten:hover {border-bottom: 4px solid #f30;}
    </style>
    </head>
    <body>
    	<div id="topMenu">
    		<ul id="cssmenu">
    			<li id="One"><a href="#">Blog</a></li>
    			<li id="Two"><a href="#">About</a></li>
    			<li id="Three"><a href="#">Contact</a></li>
    			<li id="Four"><a href="#">Projects</a></li>
    			<li id="Five"><a href="#">Conference</a></li>
    			<li id="Six"><a href="#">Members</a></li>
    			<li id="Seven"><a href="#">Forum</a></li>
    			<li id="Eight"><a href="#">Downloads</a></li>
    			<li id="Nine"><a href="#">Login</a></li>
    			<li id="Ten"><a href="#">Register</a></li>	   
    		</ul>
    	<!--end topMenu--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    And the markup for adding that mega-menu might look like this -
    Code:
    	<div id="topMenu">
    		<ul id="cssmenu">
    			<li id="One"><a href="#">Blog</a></li>
    			<li id="Two"><a href="#">About</a></li>
    			<li id="Three"><a href="#">Contact</a></li>
    			<li id="Four"><a href="#">Projects</a>  
    				<div class="dropdown_4columns">    
    					<div class="col_4">  
    						<h2>This is a heading title</h2>  
    					</div>    
    					<div class="col_1">    
    						<h3>Some Links</h3>  
    						<ul>  
    							<li><a href="#">ThemeForest</a></li>  
    							<li><a href="#">GraphicRiver</a></li>  
    							<li><a href="#">ActiveDen</a></li>  
    							<li><a href="#">VideoHive</a></li>  
    							<li><a href="#">3DOcean</a></li>  
    						</ul>       
    					</div>    
    					<div class="col_1">    
    						<h3>Useful Links</h3>  
    						<ul>  
    							<li><a href="#">NetTuts</a></li>  
    							<li><a href="#">VectorTuts</a></li>  
    							<li><a href="#">PsdTuts</a></li>  
    							<li><a href="#">PhotoTuts</a></li>  
    							<li><a href="#">ActiveTuts</a></li>  
    						</ul>     
    					</div>    
    					<div class="col_1">    
    						<h3>Other Stuff</h3>  
    						<ul>  
    							<li><a href="#">FreelanceSwitch</a></li>  
    							<li><a href="#">Creattica</a></li>  
    							<li><a href="#">WorkAwesome</a></li>  
    							<li><a href="#">Mac Apps</a></li>  
    							<li><a href="#">Web Apps</a></li>  
    						</ul>     
    					</div>    
    					<div class="col_1">    
    						<h3>Misc</h3>  
    						<ul>  
    							<li><a href="#">Design</a></li>  
    							<li><a href="#">Logo</a></li>  
    							<li><a href="#">Flash</a></li>  
    							<li><a href="#">Illustration</a></li>  
    							<li><a href="#">More...</a></li>  
    						</ul>    
    					</div>    
    				</div>    
    			</li> 
    			<li id="Five"><a href="#">Conference</a></li>
    			<li id="Six"><a href="#">Members</a></li>
    			<li id="Seven"><a href="#">Forum</a></li>
    			<li id="Eight"><a href="#">Downloads</a></li>
    			<li id="Nine"><a href="#">Login</a></li>
    			<li id="Ten"><a href="#">Register</a></li>	   
    		</ul>
    	<!--end topMenu--></div>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Tags for this Thread

    Posting Permissions

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