I am developing a website.
On a menu section I added a sub menu.
On the sub menu, under PRODUCTS, I can't click on Air Sourced Heat Pump.
Can anyone help me?
This is my website: http://develop.com.sg/Enerprof/
This is because you have a hover action when hovering IVolt...
When you get over it, another submenu appears between IVolt and Air Sourced Heat Pump.
When getting "out" of this submenu, the IVolt menu disappears, and the Air Source option gets back to its inital position. At that moment, your cursor is OUT of the "Products" menu you want to reach...
If you want to change "no" code, (AND if your Air Source option IS NOT a submenu as IVolt is...) you just have to place it in first position in your Products menu...
Btw, we need some code to help you more...
You Give the hover effect in child node. so when you hover your mouse control he close the your submenu. change the css effect.
<ul>
<li>Spices
<ul>
<li>Ajwain Seed</li>
<li>Cardmom</li>
<li>Coriander</li>
<li>Cumin Seed</li>
<li>Dill Seed</li>
<li>Fennel Seed</li>
<li>Fenugreek</li>
<li>Red Chilli</li>
<li>Turmeric</li>
</ul>
</li>
<li>Pulses
<ul>
<li>Red Lentils</li>
<li>Green Peas</li>
<li>Cheak Peas</li>
</ul>
</li>
<li>Oil Seeds
<ul>
<li>Sesame seed</li>
<li>Rapeseeds</li>
<li>Niger Seed</li>
<li>Groundnut</li>
</ul>
</li>
<li>Grains
<ul>
<li>Maize</li>
<li>Wheat</li>
<li>Rice</li>
<li>Millet</li>
</ul>
</li>
<li>Cotton
<ul>
<li>Raw Cotton</li>
<li>Cotton Linter</li>
</ul>
</li>
<li>Animal Feed Products
<ul>
<li>houss.php</li>
<li>Rape Seed Meal</li>
<li>Soyabean Meal</li>
</ul>
</li>
</ul>
CSS :
.content2{width:883px; margin-top:5px; height:auto; margin:auto;}
.gallery-left{width:630px; height:323px; border:8px solid #f5f4f2; float:left;}
.prod-menu-right{width:210px; height:323px; border:8px solid #f5f4f2; float:right; background:url(../images/prod-menu-bg.png) repeat-x #74c305;}
.prod-menu-right h1{font-size:21px; color:white; text-align:center; margin-top:0px; font-family:"Times New Roman", Times, serif;}
.prod-menu-right ul{list-style:url(../images/arrow.png); margin:0px 25px 0px 25px; padding:0; font-size:12px;}
.prod-menu-right li{ height:25px; line-height:14px; padding-top:10px}
.prod-menu-right ul li a{color:#FFF; line-height:14px ;text-decoration:none;}
.prod-menu-right ul li a:hover{color:#333; text-decoration:underline}
.prod-menu-right li:hover{position:relative;z-index:1000; }
.prod-menu-right li:hover ul{margin-left:0px; margin-top:1px; text-align:left; width:180px;}
.prod-menu-right li:hover ul li{min-width:180px; position:relative;}
.prod-menu-right li:hover ul li a{border-bottom: 1px dotted; padding:10px 25px; color: #FFFFFF; display:block; font-size: 12px; line-height:14px; text-decoration:none; background-color:#669933;}
.prod-menu-right li:hover ul li a:hover {text-decoration:none; color:#fff; line-height:14px; background-color:#333; position:relative;}
.prod-menu-right ul li ul li { position:relative; display:inline-block;}
.prod-menu-right ul li ul li a{ display:none;}
Add <ul><li> Code and use this css to simple implement the menu... with your site..
Related
I'm working on a dropdown box but the only thing that doenst want to work is when I hover over the word Info in the unordered list the dropdownbox is not displayed.
I know I have display:none; in ul style but can you change that to display:block; when hovered over the word info?
HTML Code:
<ul id="Menu">
<li>Home </li>
<li>Info
<ul style="display:none;">
<li>Program</li>
<li>Getting Started<li>
<li>Credits</li>
</ul>
</li>
<li>Video </li>
<li>server </li>
<li>Profile </li>
<li>Help</li>
</ul>
CSS Code:
#Menu {
list-style:none;
font-size:16px;
font-weight:Bold;
padding:14px 0 0;
width:415px;
margin-top:0;
float:left;
margin-left:0;
}
#menu { list-style:none;}
li:hover > ul {display:list-item;}
li ul { margin:0; padding:0; position:absolute;z-index:5;padding-top:6px;}
li { float:left; margin-left:10px; }
li ul li { float:none; margin:0; display:inline;}
li ul li a {display:block; padding:6px 10px; background:#333; white-space:nowrap;}
li { display: list-item; text-align: -webkit-match-parent;}
ul { border:0; font-size:100%; font:inherit;vertical-align:baseline;}
Help in advanced. any help is apreciated :)
also post a code not only telling me whats wrong thanks!
use #Menu before your css class names : DEMO
like: #Menu li:hover > ul {display:list-item;}
NOTIC: css Class names are Case-Sensitive
I am thinking this is because the html code contains an inline display:none.
In the inner <ul>, we should remove <ul style="display:none;"> in the above html.
I am working on a HTML/CSS drop down menu and now whenever I hover my mouse over the top of the menu not every entry is showing in the drop menu. The top one or two entries are always missing. Here is my HTML:
<!-- Navigation Bar -->
<ul id="navi">
<li>Engines
<ul>
<li>DiniJS</li>
<li>Foxen2D</li>
<li>Vivon3D</li>
</ul>
</li>
<li>Team
<ul>
<li>Rob Myers</li>
<li>Nate Mast</li>
</ul>
</li>
<li>Contact
<ul>
<li>Email</li>
<li>Twitter</li>
</ul>
</li>
</ul>
and here is the CSS:
#navi ul {
list-style:none;
margin:0px;
padding:0px;
}
#navi li {
float:left;
width:120px;
padding-top: 13px;
padding-bottom:8px;
background-color:black;
text-align:center;
font-family:"Courier New";
}
#navi li:hover {
background-color:#303030;
}
#navi li ul li {
float:none;
width:116px;
text-align:left;
padding-left:4px;
border-top:1px solid #303030;
display:none;
font-size:85%;
position:absolute;
z-index:2;
}
#navi li:hover ul li {
display:block;
}
#navi a {
text-decoration:none;
color:red;
}
I am open to any Javascript or JQuery suggestions if that is a better way to go about fixing this. Thank you.
Your problem is that all of the submenu items are stacking one on top of another. Simply moving position: absolute; from the #navi li ul li block to a new #navi li ul block should fix this.
When using nested list items. use class names to target. for your menu use class="sub"
for submenu (ul) and set display none and absolute for the sub ul and not for the li.
I'm learning to make a vertical menu using only css (I must say most of this code was copied from google).
When I put mouse over list1, items display in the back, and LargeNameList2 is over items of list1(since "LongNameList2" has a longer name) . So what i need are 1 of 2 things(or both if possible):
-How to "bring to front" list items?, so they display over LargeNameList2.
-How to make the other lists that are below(list 2 and 3) go down when I put mouse over list1?(and list3 when I mouseover list2)?
Code HTML:
<head runat="server">
<title></title>
<style type="text/css">
#nav{
list-style:none;
font-weight:bold;
margin-bottom:10px;
float:left;
width:100%;
}
#nav li{
margin-right:10px;
position:relative;
}
#nav a{
/*display:block;*/
padding:5px;
color:#fff;
background:#333;
text-decoration:none;
}
#nav a:hover{
color:#fff;
background:#6b0c36;
text-decoration:underline;
}
/*--- DROPDOWN ---*/
#nav ul{
background:#fff; /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */
background:rgba(255,255,255,0);/* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */
list-style:none;
position:absolute;
left:-9999px; /* Hide off-screen when not needed (this is more accessible than display:none;) */
}
#nav ul li{
padding-top:5px;
float:none;
}
#nav ul a{
white-space:nowrap;
}
#nav li:hover ul{
left:0;
}
#nav li:hover a{
background:#6b0c36;
text-decoration:underline;
}
#nav li:hover ul a{
text-decoration:none;
}
#nav li:hover ul li a:hover{
background:#333;
}
</style>
</head>
<body>
<ul id="nav">
<li>
List1›
<ul style="margin-left: 25px">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ul>
</li>
<br />
<br />
<li >
LongNameList2›
<ul style="margin-left: 25px">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ul>
</li>
<br />
<br />
<li>
List3›
<ul style="margin-left: 25px">
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ul>
</li>
</ul>
</body>
You should add position:relative and z-index: 101 to your ul to make both of those things happen:
#nav li:hover ul{
left:0;
position: relative;
z-index: 101;
}
Here is a fiddle: http://jsfiddle.net/pj9Gd/
Add z-index to this -
#nav li:hover ul{
left:0;
z-index:1000; // Added this line.
}
z-index is the z coordinate of the item. Positive for nearer and negative for farther from user.
I have a navigation menu with this style. The menu is perfect on Chrome, but other browsers and some Firefox versions, the menu shows up as 2 lines. I cannot get this line of CSS "padding: 0 0.73em;" to work on all browsers.
.mainnav ul {
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
.mainnav ul li {
float:left;
}
.mainnav ul li a:link,.mainnav ul li a:visited {
display:block;
font-size:13px;
font-weight:bold;
color:#FFFFFF;
background-color:#B79527;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
margin:0;
padding: 0 0.73em;
height: 28px;
line-height: 28px;
position:relative;
white-space:nowrap;
}
.mainnav ul li a:hover,.mainnav ul li a:active {
background-color:#9A7C1C;
}
#firstmenu {
background:#7A4AAD;
padding-left: 6px;
}
Here is the HTML
<div class="mainnav">
<ul>
<li id="firstmenu">Home</li>
<li>Group News</li>
<li>About us</li>
<li>Vision Message and Mission</li>
<li>Group Activity</li>
<li>Chairman's Message</li>
<li>Jobs</li>
<li>Contact us</li>
</ul>
</div>
Even Firefox gives me different results on different machines.
you are aware that in: .mainnav ul li a:link,.mainnav ul li a:visited there are double padding decalarations?
padding:4px;
padding: 0 0.73em;
You can combine those:
padding: 4px 0.73em;
Seems that the issue with the navigation list is that there is too much spacing in between them in combination with the amount of items.
I there are too much items, the normal behavior is the wrapping, you could decrease spacing, font-size to fix this.
So, I'm trying to create a horizontal rollover menu .
Things were fine until I start working on my "current page" to show where the visitor is on the navigation bar.
I wanted to do so with a class named "active".
I want the sub menu to be visible at all time.
It seems like the <li> (from my navigation ) which are earlier in the html code than the one with the class "active", doesn't react as they are supposed to when mouse hovered; The sub menu doesn't show anymore...
I'm not sure if I'm clear or if I'm making any sense, It is still a new technology to me and explaining what's going on is quite hard.
Please let me know if you can help me or if you want me to explain differently.
Thanks a lot
Mick
UPDATES
Here are some screenshots of were I am now thanks to Wire42 (I add some lower Z index to the sub menu item as well as a white background).
So now the previous element react properly to the mouse hover but the active element (in the example "take action") doesn't show the sub menu.
image 1: the active item doesn't show the sub menu (it should show sub menu even when not mouse hovered)
image 2: problem solved for the mouse hovered items
Am I missing something?
CSS
#menu_wrapper {
padding:0;
margin:0;
position:relative;
left:108px;
top:2px;
}
#menu {
width:812px;
height:28px;
background-color: #B4B4B4;
padding:0 0 0 60px;
}
#menu li {
display: inline;
list-style-type: none;
}
#menu li a {
font-size: 13px;
text-transform: uppercase;
font-family: Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
float: left;
color: #000000;
padding: 6px 13px;
border-right: 1px solid #999;
}
/* get rid of last border in menus*/
#menu li:last-child a, #menu li.active li:last-child a, #menu li:hover li:last-child a{
border:none;
}
#menu li:hover > a {
background-color: #e9748b;
}
#menu li.active > a {
background-color: #e9748b;
}
/*-------------------SUB MENU---------------*/
#menu li ul {
display:none;
padding:0 0 0 60px;
}
#menu li:hover > ul {
display:block;
position:absolute;
padding: 0 0 0 90px;
left:0; top:28px;
background:url(Images/background_sub_menu.png) repeat-x;
width:782px;
min-height:23px;
}
#menu li.active > ul{
display:block;
position:absolute;
padding: 0 0 0 90px;
left:0; top:28px;
background:url(Images/background_sub_menu.png) repeat-x;
width:782px;
min-height:23px;
z-index: -1;
}
#menu li li {
list-style:none;
}
#menu li li a, #menu li.active li a{
color:#000000;
background:none;
text-decoration:none;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
text-transform: none;
border-right: 1px solid #999;
padding:5px 10px;
margin:0;
}
#menu li.active li a{
z-index:-1;
}
#menu li li a:hover {
background:none;
font-weight: bolder;
color: #000000;
background-color: #CC6633;
}
#menu li li.active a {
text-decoration:underline;
background:none;
font-weight: bolder;
color: #000000;
z-index:-1;
}
HTML
<ul id="menu">
<li>Home
<ul>
<li> </li>
</ul>
</li>
<li>About the Foundation
<ul>
<li>What we do</li>
<li>Who we are</li>
<li>Goals for 2012</li>
<li>Annual reports</li>
<li>Help 4 Guys .com</li>
</ul>
</li>
<li>Programs
<ul>
<li>Male Abuse Awarness Week</li>
<li>Help 4 Guys .com</li>
<li>Events</li>
</ul>
</li>
<li class="active">Take Action
<ul>
<li>Volunteer for PLF</li>
<li>Help our Foundation</li>
<li class="active">Donate</li>
<li>FAQ</li>
</ul>
</li>
<li>Find Support
<ul>
<li>Child Abuse FAQ</li>
<li>Find Support Near You</li>
<li>Support for the Families</li>
<li>Privacy</li>
<li>Our Network</li>
</ul>
</li>
<li>Contact Us
<ul>
<li></li>
</ul>
</li>
</ul>
Here's a solution using purely CSS, no javascript:
http://jsfiddle.net/nammp/1/
This code does two things (which, as I answer this, are hacked in there, but I will go back and clean it up if someone else doesn't get to it first):
Active elements receive a z-index of -1 and so are rendered under the hover elements
Hover elements get a white background-color so they visually hide the active elements
I think this solves the problem. Hopefully we can clean up this question so the code is a little more generic.
I changed UL li menu with working sample.
please look into the link. http://jsfiddle.net/abhishekbhalani/ZzF6S/
Let me know if any issue.
Refer below urls, I think it would be useful for you.
Tab changes on Mouseover
simple css hover tab thingy
Thanks
Abhishek