there is a double red line on hover state on my active link (another red line appears on dropdown menu. How to fix this. Also when i moving on dpopdown menu active state dissapears.
JSFIDDLE
Thank you.
Have a nice day.
[1]: http://jsfiddle.net/uj5k5ecq/
Adding a new class .jqueryslidemenu ul li a.active:hover and giving it a border-bottom:0; should do it, but there's something that I'm trying to figuring out is why the drop down is not filling that 5px removed from the border-bottom ... until now I have this:
.jqueryslidemenu ul li a.active:hover {
border-bottom:0;
}
======== Update ==========
I figured it out, it's somehere in your jquery code (probably in your file jqueryslidemenu.js) that has a static position for your dropdown of top:56px; by giving a new top value for .jqueryslidemenu ul li ul through your css like this it will fix this issue
.jqueryslidemenu ul li ul {
top: 51px !important;
}
Online demo here
but perhaps you should find that value and change it there tho, where this top:56px; is being created
One option is to remove the on hover underline by adding this to your CSS:
#nav a:hover{text-decoration:none;}
Another option is to remove the red border when you hover over a dropdown by removing border-top: 5px solid #eb2629;. Example below:
.jqueryslidemenu ul li ul {
position: absolute;
left: 0;
margin-left: -1px;
border-top: 5px solid #eb2629; /** REMOVE THIS LINE **/
display: block;
visibility: hidden;
background: #000;
z-index: 99999;
}
A third option is to remove the active red border when you hover over the link itself:
.jqueryslidemenu ul li a.active {
border-bottom: 5px solid #eb2629; /** REMOVE THIS LINE **/
color: #eb2629;
}
Just add
#nav a {
text-decoration: none;
}
View DEMO
Your question is not very clear but I think you might mean something like this?
http://jsfiddle.net/uj5k5ecq/3/
#nav {
float: right;
margin-top: 70px;
position: relative;
}
.jqueryslidemenu ul {
z-index:9999999;
}
.jqueryslidemenu ul li {
position: relative;
float: left;
list-style:none;
}
.jqueryslidemenu ul li a {
font-weight: normal;
text-transform: uppercase;
font-size: 13px;
margin-top: 18px;
padding: 0px 20px 15px;
display: block;
text-decoration:none;
color:#000;
}
.jqueryslidemenu ul li a:hover {
border-bottom: 5px solid #eb2629;
color: #eb2629;
}
.jqueryslidemenu ul li a.active {
}
.jqueryslidemenu ul li ul {
position: absolute;
left: 0;
margin-left: -1px;
border-top: 5px solid #eb2629;
display: block;
visibility: hidden;
background: #000;
z-index: 99999;
}
/*Sub level menu list items (undo style from Top level List Items)*/
.jqueryslidemenu ul li ul li {
float: none;
font-size:12px;
width: 160px;
text-transform: none;
background-color: #000;
}
.jqueryslidemenu ul li ul li a {
margin: 0px;
color:#fff;
padding: 10px 20px 10px;
border-bottom: none;
text-transform: none;
}
.jqueryslidemenu ul li ul li a:hover {
background:#232323;
color: #FFF;
border-bottom: none;
text-transform: none;
}
Related
Once we mouse-over on "currency", we can see drop down as below:
what I need is once we mouse-over on particular currency[ row], it should show different background color like below.
<style type="text/css">
.menuBackground {
background: brown;
text-align: center;
}
.dropDownMenu a {
color: #FFF;
}
.dropDownMenu,
.dropDownMenu ul {
list-style: none;
margin: 0;
padding: 0;
}
.dropDownMenu li {
position: relative;
}
.dropDownMenu a {
padding: 10px 20px;
display: block;
text-decoration: none;
}
.dropDownMenu a:first-child {
color: #000;
}
.dropDownMenu > li {
display: inline-block;
vertical-align: top;
margin-left: -4px; /* solve the 4 pixels spacing between list-items */
}
.dropDownMenu > li:first-child {
margin-left: 0;
}
.dropDownMenu ul {
box-shadow: 2px 2px 15px 0 rgba(0,0,0, 0.5);
}
.dropDownMenu > li > ul {
text-align: left;
display: none;
background: green;
position: absolute;
top: 100%;
left: 0;
width: 240px;
z-index: 999999;
}
</style>
How?
its good to add colors on anchor tag not to li because you have already styled color on anchor, So just add hover css on anchor you will see what you want.
.dropDownMenu li a:hover {
background: #fff; /*Your color*/
color: #000; /*Your color*/
}
When you want to do is give style on ul li then consider as parent > child. So what you need is to change the background color and color on hover of li.
.dropDownMenu a:hover {
color: #000;
background: #fff;
}
What i did is, i give css on hover of your dropdown menu. You can do it for more child according to > selector.
Try this, on particular row hover effect as below:
And change background-color for currency li hover green to white.
.dropDownMenu > li > ul {
background: white none repeat scroll 0 0;
display: block !important;
left: 0;
position: absolute;
text-align: left;
top: 100%;
width: 240px;
z-index: 999999;
}
ul.dropDownMenu li ul li:hover {
background-color: green;
}
Just add following css will make like your expected output.
#select-language ul li:hover
{
background-color:white
}
I'm trying to keep the parent nav background active when on child page.
Example: Portfolio---->Programs
When my current page is Programs, I'd like to keep the Portfolio active on the navigation bar.
The code use in the CSS is:
/* Navigation
--------------------------------------------------------------------------------*/
#nav-wrap {
max-height: 200px;
}
#nav .container ul {
list-style: none !important;
}
#nav .container ul li {
list-style: none !important;
}
#nav .container ul span:last-child li,
#nav .container ul > li:last-child {
/*background: none;*/
background:url(surf_40.gif) no-repeat -12px;
}
#nav ul li a {
display: block;
font-size:30px;
line-height: 35px;
padding: 10px 0;
color: rgba(255,255,255,0.4);
padding: 2px 25px 2px 21px;
border: 0;
outline: 0;
list-style-type: none;
position:relative;
right:-4px;
z-index:1;
text-transform: uppercase;
font-family: 'Aller', sans-serif;
}
#nav ul li#active a {
background: url(surf_40.gif) no-repeat -12px;
}
#nav ul li#active a,
#nav ul li a:hover {
color: #fff;
border: 0;
}
/**Text modified added - for active parent while my current page is a sub-menu***/
#wsite-menus .wsite-menu li #active a #nav ul li a {
color: #fff;
border: 0;
}
/*---*/
/* Navigation Submenu's
--------------------------------------------------------------------------------*/
#wsite-menus .wsite-menu li a {
color: rgba(0,0,0,0.4);
font-weight: bold;
background: #fff;
/*border: 0 px;*/
border: solid thick;
border-radius: 1em;
/* fine modifica*/
position:relative;
right: 0 px;
}
#wsite-menus .wsite-menu li a:hover {
color: #000;
background: #e3e3e3;
border: solid thick orange;
}
thank you for any help..
HTML code:
<div id="nav">
<ul class='wsite-menu-default'>
<li id='pg962547086691527768'><a href="/" data-membership-required="0" >Home</a></li>
<li id='pg623326219140352077'><a href="/about.html" data-membership-required="0">About</a</li>
</ul></div>
Put the :hover on li's instead of a:hover and alos add class active to li. if you provide html two then i will provide you the perfect solution thanks
working on a simple nav bar. so far its working perfectly for me minus one minor detail. when it drops down i want the middle sections to remain a rectangle and the bottom section to always be curvy on the bottom. right now I have it so the bottom section is curvy, though when I hover over it the regular rectangle shows back up. I tried to fix it myself, but all I could get to work was it would change all sections to curvy
here is a jsFiddle of what I am working on: http://jsfiddle.net/7mjEC/
and here is the css:
#charset "utf-8";
#topMenu {
padding: 0px;
width: 760px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
position: relative;
top: 80px;
}
#topMenu ul {
margin: 0px;
padding: 0px;
}
#topMenu ul li {
background-color: #666;
float: left;
border: 1px solid #999999;
position: relative;
list-style-type: none;
}
#topMenu ul li a {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14px;
line-height: 30px;
color: #FFF;
text-decoration: none;
text-align: center;
display: block;
height: 30px;
width: 150px;
}
#topMenu ul ul {
position: absolute;
visibility: hidden;
top: 31px;
}
#topMenu ul li ul li a:hover {
background-color: #39F;
}
#topMenu ul li:hover ul {
visibility: visible;
}
#topMenu ul li:hover {
background-color: #919191;
}
#topMenu .topleftmenuitem {
border-radius: 20px 0 0 20px;
}
#topMenu .toprightmenuitem {
border-radius: 0 20px 20px 0;
}
#topMenu .topleftmenuitem:hover {
border-radius: 20px 0 0 0;
}
and #topMenu .toprightmenuitem:hover {
border-radius: 0 20px 0 0;
}
#topMenu ul ul li:last-child {
border-radius: 0 0 20px 20px;
}
see when you hover over the last child it turns from curved to rectangle, I just want to keep it always curved.
You need to use :last-of-type or :last-child pseudo
#topMenu > ul > li > ul > li:last-of-type a:hover {
border-radius: 0 0 20px 20px;
background: #f00; /* You can remove this, its just for a demo */
}
Demo
The above selector means, select direct child ul to element having an id of #topMenu, than select direct li to that ul, moving further applies the same and at the end, we select the last li child which is nested under level 2 ul and we apply the styles on a:hover
I have updated your fiddle. You DO NOT need to break all of the ul's up like this. Please see my Fiddle for much simpler code:
http://jsfiddle.net/7mjEC/2/
The only css change you really need is to add ONE selector in:
ul ul li:last-child,
ul ul li:last-child a {
border-radius: 0 0 20px 20px;
}
I am having a simple problem with my CSS dropdown menu, I want to make it so the dropdowns are equal length to the button above them. See example below, I just want to stretch the block to the length of the above block.
New user, can't upload image
If you use my jsFiddle link you can see my code, and edit it live. I'll post the code anyway just in case.. Note I am only posting the CSS stylesheet in here as the HTML is not part of the problem.
/* Dropdown Menu */
#nav {
float: right;
width: 600px;
height: 90px;
margin: 0 auto;
padding-top: 65px;
}
#nav ul {
font-family: Arial, Verdana;
font-size: 14px;
margin: 0;
padding: 0;
list-style: none;
float: right;
}
#nav ul li {
display: block;
position: relative;
float: left;
}
#nav li ul { display: none; }
#nav ul li a {
display: block;
text-decoration: none;
color: #ffffff;
border-top: 1px solid #ffffff;
padding: 5px 15px 5px 15px;
background: #3636FE;
margin-left: 1px;
white-space: nowrap;
}
#nav ul li a:hover { background: #3636FE; }
#nav li:hover ul {
display: block;
position: absolute;
}
#nav li:hover li {
float: none;
font-size: 11px;
}
#nav li:hover a { background: #3636FE; }
#nav li:hover li a:hover { background: #6868FE; }
Fixed. (at least for Chrome+Firefox+IE9)
http://jsfiddle.net/QZWj3/4/
You had to add width: 100% to #nav li:hover ul and to #nav li:hover li
I seem to be running into a strange issue with IE7.
If you visit the following URL, http://tinyurl.com/3qrbhn4, and hover over the main navigation at the top, right above the header image in Chrome, Firefox, and IE8, the sub nav that displays once you hover over a nav element (for example, hover over Meetings) appears to line up correctly with the parent LI. However, if you try hovering over the main nav in IE7, the subnav appears one pixel off.
If you inspect the nested UL, which is #mainNav ul ul, you'll notice that it's being positioned absolutely inside of the parent UL with a left vale of 0.
If I give it a left value of left:1px, however, it lines up correctly in IE7, but breaks in Chrome/FF/IE8.
I'm not sure why this is happening, and I currently have the parent UL (#mainNav ul) positioned relatively, so I'm not sure why there would be a difference in how IE7 displays the subnav UL. I know I can "fix" this with an IE hack and just force IE7 to display the subnav ul with a left value of 1px, but I'd like to avoid that route if possible.
Can anyone help? Please let me know if I've provided enough information! I'm listing the CSS for the nav elements in question:
/* NAVIGATION *********************************************************************************************** */
#mainNav { position: relative; width: 951px; margin: 0 auto; padding: 15px 0; z-index: 3; }
#mainNav ul { line-height: 100%; height: 35px; margin: 0; padding: 0; font-size: 20px; width: 951px; }
#mainNav ul li { line-height: 100%; list-style: none; float: left; text-transform: uppercase; height: 100%; position: relative; display: block; }
#mainNav ul li a { line-height: 0; height: 22px; border: 1px solid transparent; text-decoration: none; padding: 7px 15px 5px; position:relative; display: block; }
#mainNav ul li a:hover { }
#mainNav ul li.hover a { }
#mainNav ul li a.current { }
#mainNav ul li.lastItem { }
#mainNav ul ul { display: none; z-index:2; position: absolute; top: 35px; left: 0px; padding: 5px 0 10px; width: 200px; height: auto; -moz-box-shadow: 3px 3px 3px #444; -moz-box-shadow: 3px 3px 3px rgba(0,0,0,0.5); -webkit-box-shadow: 3px 3px 3px rgba(0,0,0,0.5); }
#mainNav ul li.current ul { left: 1px; }
#mainNav ul li.hover ul li { background-position: 10px 8px; background-repeat: no-repeat; }
#mainNav ul li.hover ul li.hover { background-color: #baceda; background-position: 10px -20px; }
#mainNav ul li ul li { float: none; }
#mainNav ul li ul li a { background: none; line-height: 1; font-size: 15px; padding: 3px 30px 0; }
#mainNav ul li ul li.hover a { }
#mainNav ul li ul li a.current { }
Try changing #mainNav ul ul from left:1px to left:auto.