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

  • Home
  • SEARCH
  • 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 8234791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:36:04+00:00 2026-06-07T18:36:04+00:00

I have the following menu: <ul class=menu> <li class=menu_item><a href=mylink.php><img src=menu/home.png class=menu_img/></a></li> <li class=menu_item><a

  • 0

I have the following menu:

<ul class="menu">
<li class="menu_item"><a href="mylink.php"><img src="menu/home.png"  class="menu_img"/></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/me.png" class="menu_img"/></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/listeners.png" class="menu_img"/></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/favorites.png" class="menu_img" /></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/notifications.png" class="menu_img" /></a> <span class="notification_badge_count"></span></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/settings.png" class="menu_img" /></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/signout.png" class="menu_img" /></a></li>
</ul>

And here is my css for this menu:

.menu {
float:right;
}

.menu_item{
background: rgba(0, 0, 0, 0.0);
height:50px;
}

.menu li{
float:left;
height:25px;
padding:24px 10px 0 10px;
text-align: center;
font-size:12px; 
}

.menu_img {
opacity:0.5; 
filter:alpha(opacity=50); /* For IE8 and earlier */
}

Now, I would like to add drop down for one of the items in the menu, so I re-create the menu as follow:

<ul class="menu">
<li class="menu_item"><a href="mylink.php"><img src="menu/home.png"  class="menu_img"/></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/me.png" class="menu_img"/></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/listeners.png" class="menu_img"/></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/favorites.png" class="menu_img" /></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/notifications.png" class="menu_img" /></a> <span class="notification_badge_count"></span></li>

<li class="menu_item"><a href="#"><img src="menu/arrow.png" class="menu_img" /></a>
<ul>
<li class="menu_item"><a href="mylink.php"><img src="menu/settings.png" class="menu_img" /></a></li>
<li class="menu_item"><a href="mylink.php"><img src="menu/signout.png" class="menu_img" /></a></li>
<ul/>
</li>

What changes I should I do to add the drop down on the arrow icon?

I could easily find copy paste menu, but then It will be more difficult to understand how the css drop down is created…

Regards,Zoran

  • 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-07T18:36:05+00:00Added an answer on June 7, 2026 at 6:36 pm

    Is this what you need ? I have removed images since i didn’t have them. Instead, I have just put some text.
    http://jsfiddle.net/9ZBJG/

    html:

    <ul class="menu">
        <li class="menu_item">
            <a href="mylink.php">
                HOME
            </a>
        </li>
        <li class="menu_item">
            <a href="mylink.php">
                ABOUT ME
            </a>
        </li>
        <li class="menu_item">
            <a href="mylink.php">
                LISTENERS
            </a>
        </li>
        <li class="menu_item">
            <a href="mylink.php">
                FAVORITES
            </a>
        </li>
        <li class="menu_item">
            <a href="mylink.php">
                NOTIFICATIONS
            </a>
            <span class="notification_badge_count">4</span>
        </li>
        <li class="menu_item">
            <a href="#">
                ARROW
            </a>
            <ul>
                <li class="menu_item">
                    <a href="mylink.php">
                        SETTINGS
                    </a>
                </li>
                <li class="menu_item">
                    <a href="mylink.php">
                        SIGNOUT<img src="menu/signout.png" class="menu_img" />
                    </a>
                </li>
            <ul/>
        </li>
    </ul>
    

    CSS:

    .menu {
    float:right;
    }
    
    .menu_item{
    background: rgba(0, 0, 0, 0.0);
    }
    
    .menu > li.menu_item{
    float:left;
    height:25px;
    padding:24px 10px 0 10px;
    text-align: center;
    font-size:12px;
    background-color:#f6f6f6;
    position:relative;
    }
    
    .menu_item ul{
        display:none;
    }
    
    .menu_img {
    opacity:0.5;
    filter:alpha(opacity=50); /* For IE8 and earlier */
    }
    
    .menu_item ul{
        display:none;
    }
    
    .menu_item:hover ul{
        display:block;
        position:absolute;
        right:0px;
        top:100%;
    }
    
    .menu_item ul li{
        background-color:#f6f6f6;
        padding:5px;
    }
    

    EXPLANATION
    The structure of css menus is generally as under :

      – MAIN MENU CONTAINER

    • – MENU ITEM
        – SUB MENU CONTAINER

      • – SUB MENU ITEM
      • – SUB MENU ITEM

    If you followed till here, great!
    Now all our main menu items need to be next to each other on one line…which is why you used float:left; That’s the correct way. But .menu_item is also a class given to sub-menu-items. So I had e a few adjustments so that float:left is only taken by direct children of the main menu container.

    Now the SUB-MENU in your case is a , which you have to bring under it’s parent

  2. For that, you position the parent
  3. as absolute and position it’s child – – as relative and position accordingly using left and top value. top:100% would mean immediately under the main menu_item.
  4. Now the menu_item in this sub-menu container need to be one below the other. For that, do not give float/position/display properties to these menu_items and the code works fine. (we did that before already)

    I did a little CSS-play here with backgrounds and height to help you understand. Feel free to ask more questions. Cheers!

  • 0
  • Reply
  • Share
    Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp
    • Report

Sidebar

Related Questions

I have the following HTML: <div class=menu> <a class=main-nav-item href=home>home</a> <a class=main-nav-item-current href=business>business</a> <a
if i have the following links : <a href="#" onclick="return navigateTo(this)" id="menuList:0:menu" class="normalLink"> <span
i have the following menu: <ul class=menu menu-vert-01> <!--start--> <li><a href=#Semantic-Technologies>Semantic Technologies</a></li> <li><a href=#Business-Intelligence-Solutions>Business
I have the following menu items: <ul> <li class=static> <a class=static menu-item href=/mySites/AboutUs>About Us</a>
Hey Guys, i have created the following Menu Structure: <div id=menu> <ul> <li><a href=#>Main
I have the following jquery script: $(function(){ $('#top-menu').on('click', 'a.change-menu', function(e){ e.preventDefault() $(#menu-change-div).load($(this).attr(href)); }); });
I have the following: class Menu < ActiveRecord::Base has_many :menu_headers # has_many :menu_headers, :conditions
I have the following code which gives the menu item a class of 'current'.
I have the following drop down menu and the background looks black in Chrome
In my head.phtml , I have following declaration for getting a menu work. <script

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.