...

View Full Version : DropDown menu could not be open to full due to next <h1> tag on hover



TargetFighter
07-08-2011, 01:48 PM
hi, i m fairly new to css, however have got to work on css. well no problem.. i want to do it with my full devotion..
so in order to achieve drop down menu i have wrote this css code after a day long googling and wants to display background color{#FFFFCC} even when list slides down on mouse hover covering whole list items.
There is one more problem that my list could not be display in full mode due to the next heading element, that i could not figure out why it is being so. List gets disappear as soon as user goes down to other options.
code is as follows-

#mbar
{
margin:0;
position : absolute;
height:50px;
width: 1000px;
background:url("../images/bar_full_4_2.jpg") repeat-x;
top:240px;
left:144px;
}

#nav
{
margin:0px;
padding:0px;
position:absolute;
top: 5px;
left:8px;
display:block;
width: 490px;
}

#nav > li
{
list-style-type:none;
float:left;
display:block;
margin:0px 10px;
padding:10px;
width:116px;
text-transform:uppercase;
height: 21px;
z-index:10;
}

#nav > li:hover ul
{
display:block;
position:absolute;
}

#nav > li:hover
{
background-color:#FFFFCC;
-moz-border-radius:10px;
-webkit-border-radius:10px; text-transform:uppercase;}

#nav li ul{margin:0px;padding:0px;display:none;}

#nav li ul li { list-style-type:none; margin:10px 0 0 0;}

#nav li ul li a
{
display:block; padding:5px 10px; color:#00FFFF; text-decoration:none;
}
#nav li ul li:hover a { background-color:#003399; -moz-border-radius:5px; -webkiborder-radius:5px;}
#nav li span { cursor:pointer; margin:0px 10px; font-weight:bold;
}

Sammy12
07-08-2011, 06:01 PM
there's no > in css. can you post your entire script including html?

from what you say, you can use z-index to overlap another element.

alykins
07-08-2011, 11:44 PM
there's no > in css. can you post your entire script including html?

from what you say, you can use z-index to overlap another element.

that's a new one for me :D i think OP was trying to do #nav.li? and held down the shift key :D
.....
but then i scrolled down some to look at code more and found multiple occurrences... hmm...

alykins
07-08-2011, 11:48 PM
and then i found this... so it's something i will now dive into and check out bc i havent seen it yet :D http://www.webmasterworld.com/forum83/5944.htm

alykins
07-09-2011, 12:01 AM
so if i am understanding this correctly- and i think i am :D- (http://www.w3.org/TR/CSS2/selector.html#child-selectors when your li's (or whatever) are child elements of #nav then they get that style. now- you are also doing the same thing though by saying #nav li{}... so i think you are rewriting your CSS

Sammy12
07-09-2011, 06:37 AM
wow are you saying that is valid? can't believe i didnt know that. I read that link, I knew about [], but it never occurred to me there was > and +.

alykins
07-09-2011, 10:07 PM
wow are you saying that is valid? can't believe i didnt know that. I read that link, I knew about [], but it never occurred to me there was > and +.

yup it's valid :D i don't understand when you would use the > tag.. the + one makes sense... iguess if i encounter a situation that the > is applicable i will then see a use for it; so far i have not needed it though



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum