Dorkmind Posted November 26, 2014 Share Posted November 26, 2014 (edited) So i have a <drop down> menu, and a <nav> menu on my left side of the page. I have a problem when i click at the first column of my drop down menu and it explores submenu, the submenu mixes with the nav menu that is under the drop down menu on the left. i could solve it with margin-top of the nav menu but i don't like the empty space beetwen them. I tried with putting overflow:visible; in CSS of my dropdown menu but it is still the same. drop down menu is seen but there is stil seen nav menu under and they are mixed. So basicly i want my dropdown menu to be priority, so when i clicks on my first column (only first column is problem because there under is nav menu the other are open nice) it will explore submenu and the part of nav menu that covers the submenu will be hidden. Here is the screen shot: Here is the code of head <dropdown> menu if someone finds the problem. #menu, #menu ul { margin: 0; padding: 0; list-style: none; } #menu { width: 900px; margin-top:20px; margin-left:auto; margin-right:auto; border: 1px solid #222; background-color: #111; background-image: linear-gradient(#444, #111); border-radius: 6px; box-shadow: 0 1px 1px #777; } #menu:before, #menu:after { content: ""; display: table; } #menu:after { clear: both; } #menu { zoom:1; } #menu li { float: left; border-right: 1px solid #222; box-shadow: 1px 0 0 #444; position: relative; } #menu a { float: left; padding: 12px 30px; color: #999; text-transform: uppercase; font: bold 12px Arial, Helvetica; text-decoration: none; text-shadow: 0 1px 0 #000; } #menu li:hover > a { color: #fafafa; } *html #menu li a:hover { /* IE6 only */ color: #fafafa; } #menu ul { margin: 20px 0 0 0; _margin: 0; /*IE6 only*/ opacity: 0; visibility: hidden; position: absolute; top: 38px; left: 0; z-index: 1; background: #444; background: linear-gradient(#444, #111); box-shadow: 0 -1px 0 rgba(255,255,255,.3); border-radius: 3px; transition: all .2s ease-in-out; } #menu li:hover > ul { opacity: 1; visibility: visible; margin: 0; } #menu ul ul { top: 0; left: 150px; margin: 0 0 0 20px; _margin: 0; /*IE6 only*/ box-shadow: -1px 0 0 rgba(255,255,255,.3); } #menu ul li { float: none; display: block; border: 0; _line-height: 0; /*IE6 only*/ box-shadow: 0 1px 0 #111, 0 2px 0 #666; } #menu ul li:last-child { box-shadow: none; } #menu ul a { padding: 10px; width: 130px; _height: 10px; /*IE6 only*/ display: block; white-space: nowrap; float: none; text-transform: none; } #menu ul a:hover { background-color: #0186ba; background-image: linear-gradient(#04acec, #0186ba); } #menu ul li:first-child > a { border-radius: 3px 3px 0 0; } #menu ul li:first-child > a:after { content: ''; position: absolute; left: 40px; top: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #444; } #menu ul ul li:first-child a:after { left: -6px; top: 50%; margin-top: -6px; border-left: 0; border-bottom: 6px solid transparent; border-top: 6px solid transparent; border-right: 6px solid #3b3b3b; } #menu ul li:first-child a:hover:after { border-bottom-color: #04acec; } #menu ul ul li:first-child a:hover:after { border-right-color: #0299d3; border-bottom-color: transparent; } #menu ul li:last-child > a { border-radius: 0 0 3px 3px; } Here is the code of <nav> menu if someone finds the problem. #cssmenu { width:15%; padding: 0; margin-top: 50px; margin-left:auto; margin right:auto; float:left; border: 0; line-height: 1; } #cssmenu ul, #cssmenu ul li, #cssmenu ul ul { list-style: none; margin: 0; padding: 0; } #cssmenu ul { position: relative; z-index: 597; float: left; } #cssmenu ul li { float: left; min-height: 1px; line-height: 1em; vertical-align: middle; position: relative; } #cssmenu ul li.hover, #cssmenu ul li:hover { position: relative; z-index: 599; cursor: default; } #cssmenu ul ul { visibility: hidden; position: absolute; top: 100%; left: 0px; z-index: 598; width: 100%; } #cssmenu ul ul li { float: none; } #cssmenu ul ul ul { top: -2px; right: 0; } #cssmenu ul li:hover > ul { visibility: visible; } #cssmenu ul ul { top: 1px; left: 99%; } #cssmenu ul li { float: none; } #cssmenu ul ul { margin-top: 1px; } #cssmenu ul ul li { font-weight: normal; } /* Custom CSS Styles */ #cssmenu { width: 200px; background: #333333; font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; zoom: 1; font-size: 12px; } #cssmenu:before { content: ''; display: block; } #cssmenu:after { content: ''; display: table; clear: both; } #cssmenu a { display: block; padding: 15px 20px; color: #ffffff; text-decoration: none; text-transform: uppercase; } #cssmenu > ul { width: 200px; } #cssmenu ul ul { width: 200px; } #cssmenu > ul > li > a { border-right: 4px solid #1b9bff; color: #ffffff; } #cssmenu > ul > li > a:hover { color: #ffffff; } #cssmenu > ul > li.active a { background: #1b9bff; } #cssmenu > ul > li a:hover, #cssmenu > ul > li:hover a { background: #1b9bff; } #cssmenu li { position: relative; } #cssmenu ul li.has-sub > a:after { content: '+'; position: absolute; top: 50%; right: 15px; margin-top: -6px; } #cssmenu ul ul li.first { -webkit-border-radius: 0 3px 0 0; -moz-border-radius: 0 3px 0 0; border-radius: 0 3px 0 0; } #cssmenu ul ul li.last { -webkit-border-radius: 0 0 3px 0; -moz-border-radius: 0 0 3px 0; border-radius: 0 0 3px 0; border-bottom: 0; } #cssmenu ul ul { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } #cssmenu ul ul { border: 1px solid #0082e7; } #cssmenu ul ul a { font-size: 12px; color: #ffffff; } #cssmenu ul ul a:hover { color: #ffffff; } #cssmenu ul ul li { border-bottom: 1px solid #0082e7; } #cssmenu ul ul li:hover > a { background: #4eb1ff; color: #ffffff; } #cssmenu.align-right > ul > li > a { border-left: 4px solid #1b9bff; border-right: none; } #cssmenu.align-right { float: right; } #cssmenu.align-right li { text-align: right; } #cssmenu.align-right ul li.has-sub > a:before { content: '+'; position: absolute; top: 50%; left: 15px; margin-top: -6px; } #cssmenu.align-right ul li.has-sub > a:after { content: none; } #cssmenu.align-right ul ul { visibility: hidden; position: absolute; top: 0; left: -100%; z-index: 598; width: 100%; } #cssmenu.align-right ul ul li.first { -webkit-border-radius: 3px 0 0 0; -moz-border-radius: 3px 0 0 0; border-radius: 3px 0 0 0; } #cssmenu.align-right ul ul li.last { -webkit-border-radius: 0 0 0 3px; -moz-border-radius: 0 0 0 3px; border-radius: 0 0 0 3px; } #cssmenu.align-right ul ul { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } Edited November 26, 2014 by Dorkmind Quote Link to comment Share on other sites More sharing options...
Dorkmind Posted November 26, 2014 Author Share Posted November 26, 2014 i see that the problem is this right border in <nav> menu #cssmenu > ul > li > a { border-right: 4px solid #1b9bff ; color: #ffffff; } if i remove it the problem is solved but i really like it so is there another solution Quote Link to comment Share on other sites More sharing options...
Dorkmind Posted November 28, 2014 Author Share Posted November 28, 2014 Anyone? Please Quote Link to comment Share on other sites More sharing options...
hansford Posted November 29, 2014 Share Posted November 29, 2014 This is really a css question, not a php one, so the moderators will likely move it to the appropriate forum. Try setting the z-index of the main menu higher than the navigation menu. here is the nav menu: #cssmenu ul { position: relative; z-index: 597; float: left; } Set the same on the main menu, but make the number like 999; 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.