html5 - How to make difference between menu and dropdown submenu with CSS3 -
html5 - How to make difference between menu and dropdown submenu with CSS3 -
i got problem submenu, want have different color of submenu when parent clicked, don't want submenu inherits .active class styling parent it's in code. submenu gray when parent "usluge" clicked , need dark blue. on hover acts normal, should. can help?
here html:
<header class="topheader"> <nav> <div class="nav-btn"></div> <ul class="navi"> <li><a href="index.html">početna</a></li> <li><a href="o_nama.html">o nama</a></li> <li><a href="ordinacija.html">ordinacija</a></li> <li class="active"><a href="usluge.html">usluge</a> <ul> <li><a href="usluge.html">restaurativna dentalna medicina</a></li> <li><a href="usluga2.html">estetska dentalna medicina</a></li> <li><a href="usluga3.html">dječja dentalna medicina</a></li> <li><a href="usluga4.html">endodoncija</a></li> <li><a href="usluga5.html">dentalna protetika</a></li> <li><a href="usluga6.html">oralna kirurgija</a></li> <li><a href="usluga7.html">parodontologija</a></li> <li><a href="usluga8.html">rendgen</a></li> </ul> </li> <li><a href="kontakt.html">kontakt</a></li> </ul> </nav> </header>
here css:
/*---menu---*/ .topheader { text-decoration: none; display:inline-block; } .topheader nav{ text-align:left; margin-left: 50%; position:absolute; margin-top:169px; width:490px; padding:0; } .topheader nav ul{ list-style: none; margin: 0 auto; padding:0; display:inline-block; } .topheader nav ul li{ float: left; display: inline-block; position:relative; margin:0; padding:0; } .topheader ul li a:link, .topheader ul li a:visited{ color: #fff; display: inline-block; padding: 17px 20px; font-size: 110%; height: 16px; } .topheader nav a:hover, .topheader nav a:active, .topheader ul .active a:link{ background-color: #aeadad; text-shadow: none; } /*---submenu---*/ .topheader ul li ul{ position:absolute; visibility:hidden; display:block; z-index:10000; } .topheader ul li ul li{ text-align:left; padding:0; margin:0; width:150px; } .topheader ul li ul li a{ padding:0; margin:0; width:130px; background-color: #01415a; border-top: 1px solid #7bc4f1; } .topheader ul li ul a:link, .topheader ul li ul a:visited{ color: #fff; display:table-cell; padding:15px 15px; font-size: 105%; } .topheader ul li ul li:hover, .topheader ul li ul a:hover{ background-color: #68a2ba; } .topheader ul li:hover ul{ visibility:visible; } .topheader nav ul li a:active .topheader nav ul li ul li a{ background-color: #01415a; }
please right css concept....
below illustration link's help clear dropdown menu concept...
1) first link
2) second link
3) third link
these link contain different style's of dropdown menu, easy understand if have of basic css concept...
html5 css3 drop-down-menu
Comments
Post a Comment