IE6 dropdown Navigation not working - internet-explorer-6

My dropdown menu is not working in IE6. Here is the css code
a:focus {
outline:none;}
.menu {
width:1000px;
height:32px;
position:relative;
z-index:100;
font-family:arial, sans-serif;
}
/* hack to correct IE5.5 faulty box model */
* html .menu {
width:1000px;
}
/* remove all the bullets, borders and padding from the default list styling */
.menu ul {
padding:0;
margin:0;
list-style-type:none;
}
.menu ul ul {
width:149px;
}
/* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */
.menu li {
float:left;
width:149px;
position:relative;
border-top: #999 1px solid;
margin-right:10px;
}
.menu li:hover {
float:left;
border-top: #ff0 1px solid;
}
.nav-selected {
font-weight: bold;
}
.menu li li:hover {
float:left;
border-top: none;
color: #999;
}
.menu li li {
float:left;
width:149px;
position:relative;
border-top: none;
}
/* style the links for the top level */
.menu a, .menu a:visited {
display:block;
font-size:12px;
text-decoration:none;
color:#999;
width:149px;
height:26px;
line-height:29px;
}
/* a hack so that IE5.5 faulty box model is corrected */
* html .menu a, * html .menu a:visited {
width:149px;
w\idth:149px;
}
/* style the second level background */
.menu ul ul a.drop, .menu ul ul a.drop:visited {}
/* style the second level hover */
.menu ul ul a.drop:hover{}
.menu ul ul :hover > a.drop {}
/* style the third level background */
.menu ul ul ul a, .menu ul ul ul a:visited {}
/* style the third level hover */
.menu ul ul ul a:hover {}
/* hide the sub levels and give them a positon absolute so that they take up no room */
.menu ul ul {
visibility: hidden;
position:absolute;
height:0;
top:26px;
left:0;
width:150px;
}
/* another hack for IE5.5 */
* html .menu ul ul {
top:26px;
t\op:27px;
}
/* position the third level flyout menu */
.menu ul ul ul{
left:149px;
top:-1px;
width:149px;
}
/* position the third level flyout menu for a left flyout */
.menu ul ul ul.left {
left:-149px;
}
/* style the table so that it takes no ppart in the layout - required for IE to work */
.menu table {
position:absolute;
top:0;
left:0;
border-collapse:collapse;
}
/* style the second level links */
.menu ul ul a, .menu ul ul a:visited {
color:#999;
height:auto;
line-height:15px;
padding-bottom:4px;
width:149px;
}
/* yet another hack for IE5.5 */
* html .menu ul ul a, * html .menu ul ul a:visited {
width:149px;
w\idth:149px;
}
/* style the top level hover */
.menu a:hover {color:#ff0;}
.menu ul ul a:hover {color:#ccc;}
.menu :hover > a {color:#ff0;}
.menu ul ul :hover > a {color:#ccc;}
/* make the second level visible when hover on first level list OR link */
.menu ul li:hover ul, .menu ul a:hover ul{
visibility:visible;
width: auto;
}
/* keep the third level hidden when you hover on first level list OR link */
.menu ul :hover ul ul{
visibility:hidden;
}
/* make the third level visible when you hover over second level list OR link */
.menu ul :hover ul :hover ul{
visibility:visible;
}
Please help me as soon as possible...

If you're talking about the actual drop-down portions of the menu not working, it's because the overflow command is broken in IE6. IE6 does not properly display overflow properties (in this case overflow: visible to allow the dropdown menu to be shown). Unfortunately there is no easy fix. You can search on the web for some CSS Hacks for IE6 to try and fix the overflow issue, but they do not work with every case. Good luck.

Related

How to Center Content in Navigation Bar

I am unable to properly center content in the navbar. I need them to be centered like for the website's name. The HTML is fairly simple, so I assume that it is an issue in the CSS.
Navbar Image
Section of CSS:
/* Grey background color to the top navigation */
.topnav {
background-color: #F1F1F1;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: #666666;
text-align: center;
padding: 20px 25px;
text-decoration: none;
font-size: 25px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: grey;
}
/* Add an active class to highlight the current page */
.topnav a.active {
color: #666666;
font-size: 40px;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}

Want to make Superfish vertical menu Responsive

I am using super fish vertical menu but its not working on responsive view. Need to fix this for responsive.
Media queries will help you make it responsive
Have a look at this codepen another great example given in this question
following code is taken from codepen which makes the menu responsive.
#media screen and (max-width: 768px) {
body {
margin: 0; } }
#media screen and (max-width: 768px) {
header.global nav #hamburger {
display: block; } }
header.global nav ul {
margin: 0;
padding: 0 25px;
display: block; }
#media screen and (max-width: 768px) {
header.global nav ul {
display: none;
margin: 7px 0;
padding: 0; } }
#media screen and (max-width: 768px) {
header.global nav ul li {
width: 100%;
background: #2d2d2d;
border-left: none;
border-right: none;
border-top: 1px solid #474747;
border-bottom: 1px solid #141414; }
header.global nav ul li:first-child {
border-top: none; }
header.global nav ul li:last-child {
border-bottom: none; } }
#media screen and (min-width: 768px) {
header.global nav ul li:hover > a {
position: relative; }
header.global nav ul li:hover > a:after {
content: "";
position: absolute;
left: 20px;
top: 40px;
border-width: 0 8px 8px;
border-style: solid;
border-color: rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) #ef3636;
display: block;
width: 0;
z-index: 999; } }
#media screen and (max-width: 768px) {
header.global nav ul li ul {
width: 100% !important;
}
}
#media screen and (min-width: 768px) {
header.global nav ul li ul li:hover a:after {
border: none; } }

Navigation currently selected item disregards the background-color. (wayfinder, ModX)

The title pretty much describes my problem. I've got a navigation menu at the top of my page with multiple drop-down sections. Now all of the bg-colors are recognised perfectly the only problem is that the menu that you are currently in (lets say 'Weblog') then it disregards the background-color specified and it just gives it the default background. I'm using the Wayfinder snippet in ModX which basically takes all specified pages and puts them in a menu. Ill note the css below since the wayfinder call wont be of much use. I'm open for all kinds of suggestions and improvements.
Cheers,
#nav {
/* float: right; */
font-style:uppercase;
margin-left:100px;
margin-right: 62px;
margin-top: 36px;
z-index: 2;
}
#nav a{
padding: 0 10px;
letter-spacing: 1px;
}
#nav ul {
margin: 0;
padding: 0;
list-style: none;
z-index: 2;
}
#nav ul li.active a {
background: #3f3a2b;
}
#nav ul li:hover{
background-color:#3f3a2b;
}
#nav ul li {
position: relative;
}
#nav ul li a {
font-size: 13px;
padding: 4px 8px;
display: inline-block;
font-family: Georgia, "Times New Roman", Times, serif;
letter-spacing: 1px;
text-transform: uppercase;
font-weight: bold;
line-height: 28px;
color: #fff;
}
#nav ul li ul{
border: 1px solid #2a2a2a;
}
#nav ul li ul li{
}
#nav ul li ul li:hover{
background-color:#3f3a2b;
}
#nav ul li ul li a{
color:black;
font-size:11px;
line-height:15px;
border:none !important;
width:170px;
background: #FFF;
}
#nav ul li ul li a:hover{
background-color:#3f3a2b;
}
#nav ul ul,
#nav ul ul ul {
display: none;
z-index: 2;
}
#nav ul li:hover > ul {
display: block;
position: absolute;
top: 35px;
left: 0;
}
#nav ul li:hover > ul li {
float: none;
background: #FFF;
position: relative;
}
#nav ul li:hover > ul li:hover ul {
display: block;
position: absolute;
top: 0;
left: 186px;
}
#nav ul li ul li a:hover{
background-color:#3f3a2b;
color:white;
}
#nav ul li:hover ul li:hover ul {
display: block;
}
#nav ul li ul li ul li a{
/* line-height:25px !important; */
}
EDIT
Here are some screenshots explaining my problem:
^This is what all items look like.^
^This is what the menu looks like if you are currently in one of its pages^
weblog is li.active and this rule change his color:
#nav ul li.active a {
background: #3f3a2b;
}
#nav ul li.active li a {
background: white;
}
#nav ul li:hover{
background-color:#3f3a2b !important;
}
this fixed the problem for me, thank you all for thinking with me.

Can you centre this Dropdown and highlight the parent?

I have a dropdown menu working but need it centered under the parent.
You can see this in action over at http://jsfiddle.net/mayurj/a3TS9/
Specific to the example above, the two dropdown menus under "About us" and "Services" are not auto centering under their parent menu items. By the way, the second drop down menu (Services --> Media Services) works just fine (opens to the right).
Secondly, I also need the parent to remain highlighted (blue) under the two drop downs described above. I know there is something called a CSS selector, but not sure how to make it work.
Can both my issues be done with pure CSS?
------------- HTML CODE BELOW --------------------
<body>
<div id="navcontainer">
<nav id="access" role="navigation">
<div class="menu-primary-container"><ul id="menu-primary" class="menu"><li id="menu-item-64" class="current-menu-item page_item page-item-4 current_page_item menu-item-64">Home</li>
<li id="menu-item-72" class="menu-item-72">About us
<ul class="sub-menu">
<li id="menu-item-71" class="menu-item-71">Why 123 Street Capital?</li>
<li id="menu-item-67" class="menu-item-67">What is Investor Relations?</li>
<li id="menu-item-74" class="menu-item-74">Our Values</li>
<li id="menu-item-77" class="menu-item-77">Our Team</li>
<li id="menu-item-81" class="menu-item-81">Our Partners</li>
</ul>
</li>
<li id="menu-item-133" class="menu-item-133">Services
<ul class="sub-menu">
<li id="menu-item-134" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-134">Overview</li>
<li id="menu-item-68" class="menu-item-68">Customer Relationship Management / Database Management</li>
<li id="menu-item-73" class="menu-item-73">Investor Relations</li>
<li id="menu-item-76" class="menu-item-76">Media Services
<ul class="sub-menu">
<li id="menu-item-66" class="menu-item-66">Publications</li>
<li id="menu-item-70" class="menu-item-70">Press Releases</li>
<li id="menu-item-75" class="menu-item-75">T.V. Interviews</li>
</ul>
</li>
<li id="menu-item-80" class="menu-item-80">Marketing / Branding</li>
</ul>
</li>
<li id="menu-item-79" class="menu-item-79">Clients</li>
<li id="menu-item-82" class="menu-item-82">Updates & Events</li>
<li id="menu-item-83" class="menu-item-83">Contact Us</li>
</ul>
</div>
</nav><!-- #access -->
</div>
</body>
</html>
------------- CSS CODE BELOW --------------------
a, a:link, a:active, a:hover {
color:#0085c5;
text-decoration:none;
}
#access {
display: block;
float: right;
margin-right:30px;
margin-top:7px;
}
#access ul {
list-style: none;
margin: 0;
padding-left: 0;
}
#access li {
float: left;
position: relative;
}
#access a {
display: block;
line-height: 2em;
padding: 0 1em;
text-decoration: none;
}
#access ul ul {
box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
display: none;
float: left;
position: absolute;
top: 2em;
left: 0;
z-index: 99999;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: white;
line-height: 1em;
padding: .5em .5em .5em 1em;
width: 10em;
height: auto;
}
#access li:hover > a,
#access ul ul :hover > a {
background: white;
}
#access ul ul a:hover {
background: white;
}
#access ul li:hover > ul {
display: block;
}
body
{
background-image:url('/images/bg.png');
background-repeat:repeat-x;
font-family: 'Open Sans', 'Arial', 'Verdana', 'Tahoma', sans-serif;
font-size:13px;
color:#3e3e3e;
}
#access li {
text-align:center;
}
#access li a {
color:#5a5a5a;
font-size:13px;
font-weight:bold;
}
#access ul ul{
top:26px;
}
#access ul li a {
border-right:1px solid #0085c4;
}
#access ul li:last-child a {
border-right:none;
}
#access ul ul li a, #access ul ul ul li a {
border-right:none;
}
#access ul li a:hover {
background:#0085c4;
color:white;
}
#access ul ul li a {
border-bottom:1px solid white;
}
#access ul ul li {
margin-right:10px;
margin-left:10px;
border-bottom:1px solid #58595b;
}
#access ul ul li a {
width:145px;
}
#access ul ul ul li a {
width:100px;
}
#access ul ul li:last-child {
border-bottom:none;
}
#access ul ul li a:hover {
background:white;
color:#0085c4;
}
#access ul ul li:last-item a:hover {
border-bottom:1px solid white;
}
#access ul.sub-menu {
background:white;
}
#navcontainer {
width:960px;
height:39px;
background-image:url('/images/menushadow.png');
background-repeat:repeat-x;
}
Here is the fix to make your parent menus remain highlighted without using javascript.
http://jsfiddle.net/a3TS9/4/
To make parent menus highlight you need to have the :hover pseudo-class on the <li> element, not the <a> like so:
#access ul li:hover a {
background:#0085c4;
color:white;
}
Other changes were made but I only touched your css. You could clean your css up a little bit by adding some classes to your elements.

Dropdown menu keeps disappearing & menu items covered by pic in IE7

This problem only affects IE7. The hover effect works but when I attempt to hover over the sub-menu items, the menu suddenly disappears! Only, it's covered by the images in the header div. I've tried z-index and removing margin among other things but nothing works.
CSS
#menu-container{
background: url(../images/menu-bg.png) repeat-x;
height: 75px;
}
#menu{
width: 960px;
margin: 0px auto;
height: 75px;
border-left: 1px dashed #2a3f37;
}
#menu ul{
}
#menu ul li{
float: left;
line-height: 75px;
}
#menu a, #menu h2{
display: block;
}
#menu a{
text-decoration: none;
}
#menu a:hover{
color: #A00;
background: #fff;
}
#menu li{
position: relative;
z-index:2px !important;
}
#menu ul li a { /*stle for IE7*/
height: 1%;
}
#menu ul ul{
position: absolute;
top: 75px;
left:0px;
background: #000;
z-index:2px !important;
}
#menu ul li ul li a{
width: 175px;
height: 35px;
line-height: 35px;
}
#menu ul ul ul{
position: absolute;
top: 0;
left: 100%;
}
div#menu ul li ul li{
margin:0px;
}
div#menu ul ul,
div#menu ul li:hover ul ul,
div#menu ul ul li:hover ul ul
{
display: none;
}
div#menu ul li:hover ul,
div#menu ul ul li:hover ul,
div#menu ul ul ul li:hover ul
{
display: block;
z-index: 2;
}
HTML
<div id="menu-container">
<div id="menu">
<ul class="menu">
<li class=active>Home</li>
<li >Hearing
<ul>
<li>How You Hear</li>
<li>Hearing Test</li>
<li>Hearing Loss</li>
<li>Online Hearing Test</li>
</ul>
</li>
<li >Hearing Aids</li>
<li >Tinnitus</li>
<li >Patients</li>
<li >About Us
<ul>
<li>About Us</li>
<li>Top Ten Reasons</li>
<li>Our Staff</li>
<li>Our Location</li>
<li>Patient Forms</li>
</ul>
</li>
<li >Contact Us</li>
</ul><!--/menu-->
</div><!--/menu-->
</div>
<!--/menu-container-->
Ohhh such a rule there div#menu ul li:hover ul ul (and many others) are not treated by IE6 or IE7.
IE browsers until IE8 only manage :hover rules for link elements.
Check this tutorial where it's explained in detail the problem and the solution.
Good Luck!

Resources