Frustrated beyond all words, I am having trouble getting the drop downs in IE7 to line up under the parent item. They work in every other browser ~ including IE8 ~ but IE7...
The drop down part of the menu displays off to the right of the parent item in ie7.
can anyone help?
Here is the css:
/* ----------------------------------- navigation ----------------------------------------- */
/* ----------------------------------- main ----------------------------------------- */
#mainnav ul, #mainnav ul li, #mainnav ul li a {display:block;float:left;list-style:none;width:100%;margin:0;padding:0;}
#mainnav ul li {
width:auto;
}
#mainnav ul li a {
width:auto;
color:#000;
text-decoration:none;
font: 400 14pt/52px 'Crimson Text', serif;
text-transform: uppercase;
overflow:hidden;
display:block;
float:left;
}
#mainnav ul li a span {
display:inline;
float:left;
cursor:pointer;
overflow:hidden;
padding:0px 18px 0px 0px;
margin: 0px 0px 0px 18px;
}
#mainnav ul li:hover, #mainnav ul li a:hover, #mainnav ul li.active a {
color:#fff;
background:transparent url(/assets/images/layout/nav-button-sprite.png) no-repeat top left;
}
#mainnav ul li:hover a span, #mainnav ul li a:hover span, #mainnav ul li.active a span {
background:transparent url(/assets/images/layout/nav-button-sprite.png) no-repeat right top;
color:#fff;
}
/* ----------------------------------- navigation ----------------------------------------- */
/* ----------------------------------- drop downs ----------------------------------------- */
#mainnav ul li ul { /* second-level lists */
position: absolute;
background: url(/assets/images/layout/drop-down-seventy-percent.png) repeat;
width: 208px;
top:52px;
float:left;
left: -9999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
}
#mainnav ul li ul li a,
#mainnav ul li ul li a span,
#mainnav ul li ul li a:hover,
#mainnav ul li ul li a:hover span {
padding:0;
margin:0;
background-image:none;
color:#fff;
font: 12px/16px Arial, Helvetica, sans-serif;
text-transform: capitalize;
}
#mainnav ul li ul li a,
#mainnav ul li ul li a span {background-image:none !important;}
#mainnav ul li ul li a span, #mainnav ul li ul li a:hover span {width:200px;padding:4px 0px 4px 8px;}
#mainnav ul li ul li a:hover span {background-color:#88273c;}
#mainnav ul li:hover ul, #mainnav ul li.sfhover ul {
left: auto;
}
and here is the html:
<div id="mainnav">
<ul>
<li class="first level-1"><span>Home</span></li>
<li class="level-1"><span>About Us</span>
<ul>
<li class="first level-2"><span>What We Do</span></li>
</ul>
</li>
</ul>
</div>
so frustrated....
-sean
Change left: auto to left: 0:
#mainnav ul li:hover ul, #mainnav ul li.sfhover ul {
left: 0;
}
and add position: relative:
#mainnav ul li {
width: auto;
position: relative;
}
Related
I have a menu and a submenu. The submenu is only displayed when hovering over it.
QUESTION 1: I want it to be displayed permanently.
QUESTION 2: I would like it to be displayed horizontally (and not vertically as it is now).
To see what I mean, go to http://appartement-met-zeezicht.be and hover on "English". What is displayed under "English" should be displayed permanently, pereferably in a horizontal (and not vertical) way.
Thanks a lot!!
/SUBMENU/
topmenu ul li ul{ position:absolute;width:150px; z-index:999999; padding-left:0; margin-left:-10px; margin-top:24px; display:none;}
topmenu ul li ul li{ float:none; margin:0; padding:10px 0px; text-align:center; background:#302f2f url(images/pattern.png) repeat; display:block; border-bottom: 1px solid #333; height:auto;}
topmenu ul > li ul li:hover{ background:#2bb975 url(images/pattern.png) repeat;}
topmenu ul li ul li a{ font-size:14px; font-weight:normal; padding:4px;}
topmenu ul li ul li ul{left: 100%; margin-top:-27px; float:none; margin-left:0px;}
.tinynav, .tinynav1{ display:none;}
EDIT: it seems that some Javascript is overwriting the CSS, you can try to add this to style.css:
#topmenu ul li ul, #topmenu li:hover > ul {
display: block !important;
}
For the second question: in your style.css find the parts below /MENU/ and /SUBMENU/. Delete the next lines below those comments and paste this code instead:
/*MENU*/
#menu_wrap{width:100%; float:left; background:#302f2f url(images/menu_wrap.png) repeat;}
.is-sticky{ width:1000px!important;}
#topmenu{text-align:center;}
.menu-header{margin:auto; padding:0; display:block;}
#topmenu ul{ margin:0; padding:0;}
#topmenu ul li{list-style-type:none; display:inline-block; margin-top:0px;padding:25px 15px;}
#topmenu li a{ font-size:18px; color:#fff;}
#topmenu ul > li:hover{ background:url(images/transblack.png) repeat;}
#menu-icon{display:none;}
/*SUBMENU*/
#topmenu ul li ul{ position:absolute;width:auto; z-index:999999; padding-left:0; margin-left:-10px; margin-top:24px; display:none;}
#topmenu ul li ul li{ float:left; margin:0; padding:10px 0px; text-align:center; background:#302f2f url(images/pattern.png) repeat; display:block; border-bottom: 1px solid #333; height:auto;}
#topmenu ul > li ul li:hover{ background:#2bb975 url(images/pattern.png) repeat;}
#topmenu ul li ul li a{ font-size:14px; font-weight:normal; padding:4px;}
#topmenu ul li ul li ul{left: 100%; margin-top:-27px; float:none; margin-left:0px;}
You need to remove "Hover" this list.
And make this list "display: inline-block;"
You may need something like this:
ol {
display: inline-block;
vertical-align: top;
}
li {
display: inline-block;
margin-right: 10px;
width: 60px;
cursor: pointer;
vertical-align: top;
}
<div>
<ol>Spiderman</ol>
<ol>Wolverine</ol>
<ol>The Avengers <br>
<li>Iron Man</li>
<li>Captain America</li>
<li>Thor</li>
<li>Black Widow</li>
</ol>
</div>
I have this code:
/*TOPMENU*/
#menu_wrap{height: 80px; width:80%; float: left; position:relative;}
#topmenu{width:100%; float:left; }
#topmenu ul{ height: 70px; padding:0; position:relative; border-style:solid;
border-width: 1px 0px 1px 0px;} /* height determines distance between 2 border lines */
#topmenu ul li{ float:left; list-style-type:none; margin:15px;}
#topmenu ul li a{ width: 100px; line-height: 22px; text-align:center; display: block; text-decoration:none; color:#a7a9ac; font-size:25px; text-transform:uppercase} /
#topmenu ul.menu > li a:hover{ height: 50px; background:#C8C1B7; color: #fff} //when you hover on menu items
//The line above this is what I'm working on
#topmenu ul .current-menu-item a{ color:#a7a9ac;} // color of HOME font
#topmenu ul .current-menu-item ul li{ background:#1e1e1e;padding:1px 0px;}
#topmenu ul .current-menu-item ul li a{padding:4px; background:none;color:#fff;}
#topmenu ul .current-menu-parent ul .current-menu-item{background:#3e3e3e repeat;}
#topmenu ul .current-menu-parent ul .current-menu-item a{ padding:4px; background:none;}
#topmenu ul .current-menu-parent ul .current-menu-item ul .menu-item a{ padding:4px;}
#topmenu ul .current-menu-item .current-menu-item .sub-menu li a{ padding:4px;background:none;}
#topmenu ul li ul{ position:absolute;width:200px; z-index:999999; display:none; padding-left:0; margin-left:-10px;}
#topmenu ul li ul li{ float:none; margin:0; padding:0px 0px; background:#9F988F ; display:block; }
#topmenu ul li ul li a{ color:#fff; width: 186px;font-size:10px; font-weight:normal; padding:4px;}
/* #topmenu ul li ul li a, #topmenu ul li .sub-menu .current-menu-item a:hover:hover{background:#C8C1B7; color:#ffffff; } */
#topmenu ul li ul li ul{left: 100%; margin-top:-10px; float:none; margin-left:0px; display:none;}
So I'm trying to get the main menu items to have a rectangle around them when I hover over them, but that's happening to the sub menu items as well. How do I modify my code so that it only affects the main menu? I'm using a theme template so I don't have the HTML, just the CSS.
Thanks in advance!
Without the HTML it is difficult, however, you are going to need to use the direct selector in CSS..
If you are trying to apply the rectangle only to the parent ul only, use:
#topmenu > ul:hover {
/* style */
}
This will apply the CSS to the ul which is a direct child of #topmenu. Therfore it won't apply it to the other children ul.
UPDATED..
Add the following..
#topmenu ul.menu > li li a:hover {
background: red;
}
If you want it to be the same color as the background..
#topmenu ul.menu > li li a:hover {
background: #C8C1B7;
}
For sub menu i am using position:absolute so that the submenu appears on the right of the main menu. However, with position:absolute the scroller is not appearing.
Is there any way i can make the scrollbar appear on the submenu after a certain height is reached?
Here is my css:
.main-navigation{
float:left; position:relative; padding-left:3.071em; z-index:9999;
}
.main-navigation ul{ list-style:none; font-family:"Century Gothic";}
.main-navigation li{ text-transform:lowercase; display:block;}
.main-navigation li a{
display:block; color:#000;line-height:18px;
padding:0 4em 0 1.429em;}
.main-navigation li ul{
display:none; position:absolute; z-index:1; top:1px; left:90%;
}
.main-navigation li ul li{
line-height:18px; margin:0 1em 0.143em 0;
}
.main-navigation li ul li a {
display: inline-block;
line-height:14px;
padding: 0 2em;
width: 10.429em; margin:0 0 0 1em;
white-space: normal;
}
.submenu .current-menu-item a{
background:url(images/current-page.png) no-repeat left; }
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_ancestor > a {
background:url(images/current-page.png) no-repeat left;
}
.sub-menu { height:80px; position:relative; display:block;}
.main-navigation li.current_page_item ul,
.main-navigation li.current_page_parent ul,
.main-navigation li.current_page_ancestor ul { display: block; }
It's hard to answer a question like this without seeing the page, or at least the associated HTML. But perhaps you could try something like this?
.sub-menu {height:80px; overflow: auto;}
i am using tinymce to make rich text area input and i have a css styled dropdown menu (only css, no javascript). the problem is, the dropdown menu is conflicting with tinymce.
i am giving a snapshot of the problem
here is my css for my drop down menu
#menu, #menu ul{
margin:0 90px;
padding:0 10px;
list-style-type:none;
list-style-position:outside;
position:relative;
line-height:1.5em;
}
#menu a{
display:block;
padding: 5px 15px 5px 15px;
border-top: 1px solid #ffffff;
color:#fff;
text-decoration:none;
background: #1D2D4F;
margin-left: 1px;
white-space: nowrap;
}
#menu a:hover{
background-color:#475A7F;
}
#menu li{
float:left;
position:relative;
width: 150px;
}
#menu ul {
position:absolute;
display:none;
width:11.3em;
margin: 0 -10px;
}
#menu li ul a{
width:11.3em;
height:auto;
float:left;
}
#menu ul ul{
top:auto;
}
#menu li ul ul {
left:12em;
margin:0px 0 0 10px;
}
#menu li:hover ul ul, #menu li:hover ul ul ul, #menu li:hover ul ul ul ul{
display:none;
}
#menu li:hover ul, #menu li li:hover ul, #menu li li li:hover ul, #menu li li li li:hover ul{
display:block;
}
.clear{
clear:both; !important
height:0;
font-size: 1px;
line-height: 0px;
}
how do i fix this problem?
Have you tried adding a z-index:100; to the drop down menu?
The number 100 is just for test, you can change it to another number later.
I have a dropdown menu on my page but there are some problem i.e when the dropdown appear and moved down to certain limit it will disappear as shown in image.
1 ) when the dropdown appear for Mobile App Development as shown in image and moved down to Black berry its work but when i move mouse pointer to Palm the menu disappeared.css code is/* menu styles */
nav, #nav ul{
margin:0;
padding:0;
list-style-type:none;
list-style-position:outside;
position:relative;
line-height:1.5em;
}
nav a{
display:block;
padding:0px 5px;
border:1px solid #333;
color:#fff;
text-decoration:none;
text-align: center;
background-color:#333;
width:80px;
}
nav a:hover{
background-color:#fff;
color:#333;
}
nav li{
float:left;
position:relative;
border-right: 1px solid white;
}
nav ul {
position:absolute;
display:none;
width:12em;
top:1.5em;
}
nav li ul a{
width:12em;
height:auto;
float:left;
}
nav ul ul{
top:auto;
}
nav li ul ul {
left:12em;
margin:0px 0 0 10px;
}
nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul{
display:none;
}
nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul{
display:block;
}
what should i do in css so that my menu will appear on my other div.
Try to specify z-index in your css:
z-index : 100;