Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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-
    Code:
    #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; 
                           }

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    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.
    Last edited by Sammy12; 07-08-2011 at 05:03 PM.

  • #3
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,753
    Thanks
    41
    Thanked 191 Times in 190 Posts
    Quote Originally Posted by Sammy12 View Post
    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 i think OP was trying to do #nav.li? and held down the shift key
    .....
    but then i scrolled down some to look at code more and found multiple occurrences... hmm...

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,753
    Thanks
    41
    Thanked 191 Times in 190 Posts
    and then i found this... so it's something i will now dive into and check out bc i havent seen it yet http://www.webmasterworld.com/forum83/5944.htm

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #5
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,753
    Thanks
    41
    Thanked 191 Times in 190 Posts
    so if i am understanding this correctly- and i think i am - (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

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #6
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    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 +.
    Last edited by Sammy12; 07-09-2011 at 05:39 AM.

  • #7
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,753
    Thanks
    41
    Thanked 191 Times in 190 Posts
    Quote Originally Posted by Sammy12 View Post
    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 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

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •