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 7593739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:14:40+00:00 2026-05-30T21:14:40+00:00

Is it possible to show elements of an unordered list in a two-column submenu

  • 0

Is it possible to show elements of an unordered list in a two-column submenu using CSS? I want to achieve something like this, but without having several <div>s in the submenu. I tried this, but I have two issues:

  1. The submenu items do not align if they are of different widths (obvious) and I would like to keep that as it is because I do not know the length of each item
  2. I cannot keep the top menu selected when hovering over it

How can I fix these issues?

  • 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-05-30T21:14:41+00:00Added an answer on May 30, 2026 at 9:14 pm

    the sumenu items do not align if they are of different width (obvious)
    and I would like to keep that as it is because I do not know the
    length of each item

    You can use min-width for sub-menu li and so it would align or expand as per the contents.

    #menu_main ul li ul li{
        display:block; 
        margin: 0; 
        border: 1px solid red; 
        min-width: 100px;
    }
    

    I cannot keep selected the top menu (like when it is hovered)

    Define a class .active as below in your css

    a.active {color:#666 !important; background:white !important; border:2px solid #d5d5d5 !important; } 
    

    And Try below script,

    $(document).ready(function() {
        $(".mainop").hover(function() {
            var $this = $(this);
            $this.find("ul").slideDown("fast");
            $this.children('a:first-child').addClass('active');
        }, function() {
            var $this = $(this);
            $this.find("ul").slideUp("fast");
            $this.children('a:first-child').removeClass('active');
        });
    });
    

    DEMO

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

Sidebar

Related Questions

Possible Duplicate: How do I get this CSS text-decoration issue to work? I'm using
Is it possible to show multiple lines of text in grid cells using the
Would it be possible to show an image in full screen mode using silverlight.
Is it possible to show other processes in progress on an Oracle database? Something
Is it possible to show the typical iPhone maps annotation/callout bubble (MKAnnotation), on something
Is it possible to show scrollbars for scrollable html elements in android's WebView? How
I wonder if its possible to keep child elements from being animated. like in
I don't want to repeat the form elements if possible. The actual form elements
Is it possible to somehow shorten this code: var i=GetStringFromServer('/url'); if(i){ $('#Div1').hide(); $('#Div2').show(); }
Possible Duplicate: Replace individual list elements in Haskell? I have managed to make some

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.