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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    drop down css help

    here is my html code

    <body>

    <ul>
    <li>1</li>
    <li>2</li>

    <ul>
    <li>a</li>
    <li>b</li>
    <li>c</li>
    </ul>

    <li>3</li>
    </ul>

    </body>

    the problem i am having is getting the drop down list items to disappear and then reappear when you hover over the second list item.

    i have tried

    .nav li ul li
    {
    position: relative;
    left: -9999px;

    }

    but it doesn't disappear. i have also tried display: hidden and a lot of other things. this is in html 5.
    Last edited by jblevins1991; 06-02-2012 at 04:08 PM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    here is my html code
    Please post your complete code (HTML+CSS) so that we may reproduce the error at our end and then try to find a solution.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    display: hidden

    Should be either
    display:none;
    or
    visibility:hidden;

    Apply it directly to the target element, and once it works then start with the nested and get lost nonsense.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello jblevins1991,
    If abc is meant to be a dropped menu from 2 then your ul is not formed correctly. It should be more like this -
    Code:
        <ul>
            <li>1</li>
            <li>2
                <ul>
                    <li>a</li>
                    <li>b</li>
                    <li>c</li>
                </ul>
            </li>
            <li>3</li>
        </ul>
    Your code, .nav li ul li, isn't working because you have no ul nested in an li.

    Have a look at how simple a drop down menu can be.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Tags for this Thread

    Posting Permissions

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