www.webdeveloper.com
Results 1 to 2 of 2

Thread: A newbie question

  1. #1
    Join Date
    Apr 2005
    Posts
    210

    A newbie question

    I am trying html menu, following is part of code copied from google.
    Code:
    #myMenu ul 
    {
        position: absolute;
        display: none;
        z-index: 999;
    }
    
    #myMenu ul li a 
    {
        width: 80px;
    }
    I changed it to this:
    Code:
    #myMenu ul 
    {
        position: absolute;
        width: 80px;
        display: none;
        z-index: 999;
    }
    
    #myMenu li a 
    {
        width: 80px;
    }
    "width: 80px" was simply moved up.
    However, things are changed, the modified line in ul is not working again.

    Could you explain reason or differences of above code?
    I am very very ... confused with css format of this kind.

    Thanks.

  2. #2
    Join Date
    Nov 2006
    Location
    Oakland
    Posts
    500
    Assuming #myMenu ul is the CSS selector for a sub-menu:
    #myMenu ul li a refers to a hyperlink in a sub-menu
    #myMenu li a on the other hand just refers to any hyperlink in your overall menu whether its a top level menu link or a sub-menu link.

    So use #myMenu li a for the topmost links
    and specify below
    #myMenu ul li a for sublinks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles