Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8253679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:57:26+00:00 2026-06-08T00:57:26+00:00

To be more precise, I’m looking for a pure-CSS3 drop-down navigation that would slide

  • 0

To be more precise, I’m looking for a pure-CSS3 drop-down navigation that would slide out (and in) the UL elements, like a jQuery would normally work.

I’ve tried making it work with opacity and visibility, but it does not seem to work properly: either it’s distorted or it doesn’t slide out, or it slides out when the mouse is in the wrong place, etc..

Here are my CSS classes at the moment:

    #nav li ul {
    left:-20000px;
    position:absolute;
    z-index:1;
    top:42px;
    width:140px;
    opacity:0;
    -webkit-transition: opacity .25s ease .1s;
    -moz-transition: opacity .25s ease .1s;
    -o-transition: opacity .25s ease .1s;
    -ms-transition: opacity .25s ease .1s;
    transition: opacity .25s ease .1s;
}
#nav li ul:hover {
    opacity:1;
}
#nav li ul li {
    float:none;
    background-color:#fff;
    padding:9px 0 0 10px;

    height:0;
    overflow:hidden;
    -webkit-transition: height .25s ease .1s;
    -moz-transition: height .25s ease .1s;
    -o-transition: height .25s ease .1s;
    -ms-transition: height .25s ease .1s;
    transition: height .25s ease .1s;
}
#nav li ul li:hover {
    height:40px;
    overflow:visible;
}
#nav li ul li a {
    font-size:12px;
}

#nav li:hover ul {
    left:0;
}

The HTML is from WordPress, as that’s what I’m creating a theme for. Here is the code snippet, I cannot post more, as I don’t see the code anywhere. I guess this has to be answered by someone keen on WordPress as well:

<div id="nav-wrapper">
<ul id="nav">
<?php wp_nav_menu( array( 'container' => false, 'theme_location' => 'primary-menu' ) ); ?>
</ul>

It seems that it might be something like this, though I don’t really understand this line myself:

<ul id=\"%1$s\" class=\"%2$s\">%3$s</ul>

P.S. Sorry for the lack of detail about the HTML part, I’m doing the best I can with the knowledge I have and am able to find.

EDIT #2: as suggested, copying the printed out source. However, there are no “menu-item” nor “sub-menu” classes,” and I’m able to make cosmetic changes (color, borders, sizes, etc.) from the CSS classes that were provided earlier.

                <ul id="nav">
<li id="menu-item-1565" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1565"><a href="http://localhost/" rel="nofollow" title="" target="_blank">Home</a>
<ul class="sub-menu">
<li id="menu-item-1456" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1456"><a href="http://localhost/category/news/games-news/">Games</a></li>
<li id="menu-item-2324" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-2324"><a href="http://localhost/category/news/internet-news/">Internet</a></li>
<li id="menu-item-1876" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1876"><a href="http://localhost/category/news/hardware-news/">Hardware</a></li>
<li id="menu-item-1786" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1786"><a href="http://localhost/category/news/software-news/">Software</a></li>
</ul>
</li>
<li id="menu-item-1432" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1432"><a href="http://localhost/test1/">TEST #1</a></li>
<li id="menu-item-1653" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1653"><a href="http://localhost/test2/">TEST #2</a></li>
            </ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:57:27+00:00Added an answer on June 8, 2026 at 12:57 am

    Try this – http://jsfiddle.net/2mCZM/

    HTML

    <ul id="nav">
        <li><a href="#">Item 1</a>
            <ul class="sub1">
                <li><a href="#">Item 1.1</a></li>
            </ul>
        </li>
        <li><a href="#">Item 2</a>
            <ul class="sub2">
                <li><a href="#">Item 2.1</a></li>
                <li><a href="#">Item 2.2</a></li>
            </ul>
        </li>
        <li><a href="#">Item 3</a>
            <ul class="sub3">
                <li><a href="#">Item 3.1</a></li>
                <li><a href="#">Item 3.2</a></li>
                <li><a href="#">Item 3.3</a></li>
            </ul>
        </li>
    </ul>
    

    CSS

    #nav li {
        display: inline-block;
        width: 140px;
        background: beige;
        border-bottom: 1px solid orange;
        position: relative;
        height: 42px;
        line-height: 42px;
    }
    
    #nav li ul {
        position:absolute;
        left: 0;
        top:43px;
        width:140px;
        height: 0;
        overflow:hidden;
    
        -webkit-transition: height .25s linear;
           -moz-transition: height .25s linear;
             -o-transition: height .25s linear;
            -ms-transition: height .25s linear;
                transition: height .25s linear;
    }
    
    #nav li:hover ul.sub1 { height: 42px; }
    #nav li:hover ul.sub2 { height: 84px; }
    #nav li:hover ul.sub3 { height: 126px; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Code is much more precise than English; Here's what I'd like to do: import
It's too late to change the question, but more precise would have been to
I have a python application , to be more precise a Network Application that
Getting more precise, i want to generate modal popup(call it A) and in that
To be more precise: I need to be looking into a file abc.txt which
I normally like to ask much more precise questions but in this one I
i installed GWT using Eclipse wizard to be more precise, i followed this tutorial:
Or, to be a little more precise: which programming languages are defined by a
I'm struggling with a particular rewrite rule on apache. More precise, I'm struggling to
Is there an elegant way to make whitespace string. To be more precise, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.