HTML/CSS/PHP Submenu coloring -
can't find wrong menu. want when hover sub menu item background color submenu not menu items. tried here menu css.
i tried #menu ul li a:hover still affect menu items , sub items..... , need subitems.
#menu { list-style: none; padding-right: 8%; float: right; padding-top: 3.5%; clear: right; text-indent: 10px; } #menu ul { list-style:none; position:relative; float:left; margin:0; padding:0 } #menu ul { display: block; color: #fff; text-decoration: none; font-weight: 700; font-size: 12px; line-height: 32px; padding: 0 15px; font-family: "helveticaneue","helvetica neue",helvetica,arial,sans-serif } #menu ul li { position: relative; float: left; margin: 0; padding: 0; } #menu ul li.current-menu-item { } #menu ul li:hover { } #menu ul ul { display: none; position: absolute; top: 92%; left: -64%; padding: 0; background-color: #4d4d4d; } #menu ul ul li { float: none; width: 190px; } #menu ul ul { line-height: 120%; padding: 10px 15px; } #menu ul ul ul { top: 0; left: 100%; } #menu ul li:hover > ul { display: block; } 
<?php $args = array( 'theme_location' => 'pre_primary' ); ?> <?php wp_nav_menu( $args); ?>
use immediate child selector!
#menu > ul > li > a:hover
Comments
Post a Comment