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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:07:29+00:00 2026-06-01T18:07:29+00:00

I am making a drop-up using li nested in ul but am not able

  • 0

I am making a drop-up using li nested in ul but am not able to set the width of li to dynamically match the width of the ul.

Please note that the li elements are constricted within a drop-up list.

The below looks like too much css but in essence it’s just about the ul and li.

THE CSS

<style type="text/css" media="screen, tv, projection">

/* - - - ADxMenu: BASIC styles - - - */

/* remove all list stylings
.menu, .menu ul {
    margin: 0;
    padding: 0;
    border: 0;
    list-style-type: none;
    display: block;
}
*/
.menu li {
    margin: 0;
    padding: 0;
    border: 0;
    display: block;
    float: left;    /* move all main list items into one row, by floating them */
    position: relative; /* position each LI, thus creating potential IE.win overlap problem */
    z-index: 5;     /* thus we need to apply explicit z-index here... */
}

.menu li:hover {
    z-index: 10000; /* ...and here. this makes sure active item is always above anything else in the menu */
    white-space: normal;/* required to resolve IE7 :hover bug (z-index above is ignored if this is not present)
                            see http://www.tanfa.co.uk/css/articles/pure-css-popups-bug.asp for other stuff that work */
}

.menu li li {
    float: none;/* items of the nested menus are kept on separate lines */
}

.menu ul {
    visibility: hidden; /* initially hide all submenus. */
    position: absolute;
    z-index: 10;
    left: 0;    /* while hidden, always keep them at the bottom left corner, */
    bottom: 0;      /*      to avoid scrollbars as much as possible */

}

.menu li:hover>ul {
    visibility: visible;    /* display submenu them on hover */
    bottom: 100%;   /* 1st level go above their parent item */
}

.menu li li:hover>ul {  /* 2nd+ levels go on the right side of the parent item */
    bottom: 0;
    left: 100%;
}

/* -- float.clear --
    force containment of floated LIs inside of UL */
.menu:after, .menu ul:after {
    content: ".";
    height: 0;
    display: block;
    visibility: hidden;
    overflow: hidden;
    clear: both;
}
.menu, .menu ul {   /* IE7 float clear: */
    min-height: 0;
}

.menu ul ul {
    padding: 30px 30px 30px 10px;
    margin: 0 0 -30px -10px;

}


/* - - - ADxMenu: DESIGN styles - - - */

.menu, .menu ul li {
    color: #eee;
    background: #000;
}

.menu ul {
    background: #000;
    width: 11em;
}

.menu a {
    text-decoration: none;
    padding: .4em 1em;
    display: block;
    position: relative;
        font-family:BlairMdITCTTMedium;
        color:#848484;
        font-size:11px;
}

.menu a:hover, .menu li:hover>a {
    color: #ccc;
}

.menu li li {   /* create borders around each item */
    border: 1px solid #000;
}

.menu ul>li + li {  /* and remove the top border on all but first item in the list */
    border-top: 0;
}

.menu li li:hover>ul {  /* inset 2nd+ submenus, to show off overlapping */
    bottom: 5px;
    left: 90%;
}


/* Fix for IE5/Mac \*//*/
.menu a {
    float: left;
}
/* End Fix */

/*]]>*/
</style>


**THE HTML CODE**

    <ul class="menu">
        <li style="width:80px;">
        <a id="menu1" title="View all posts filed under Accessories" href="http://monique-relander.be/objects/accessories/">Accessories</a>
            <ul>
                <li><a href="http://www.aplus.co.yu/">Home</a></li>
                <li><a href="http://www.aplus.co.yu/feeds/">Feeds</a></li>
                <li><a href="http://www.aplus.co.yu/archive/">Archive</a></li>
            </ul>
        </li>
        <li style="width:80px;">
        <a title="View all posts filed under Furniture" href="http://monique-relander.be/objects/furniture/">Furniture</a>
                    <ul>
                        <li><a href="http://www.aplus.co.yu/">Home</a></li>
                        <li><a href="http://www.aplus.co.yu/feeds/">Feeds</a></li>
                        <li><a href="http://www.aplus.co.yu/archive/">Archive</a></li>
            </ul>
        </li>
        <li style="width:80px;">
        <a title="View all posts filed under Lighting" href="http://monique-relander.be/objects/lighting/">Lighting</a>
                    <ul>
                        <li><a href="http://www.aplus.co.yu/">Home</a></li>
                        <li><a href="http://www.aplus.co.yu/feeds/">Feeds</a></li>
                        <li><a href="http://www.aplus.co.yu/archive/">Archive</a></li>
            </ul>
        </li>
        <li style="width:80px;">
        <a title="View all posts filed under Mirrors" href="http://monique-relander.be/objects/mirrors/">Mirrors</a>
                    <ul>
                        <li><a href="http://www.aplus.co.yu/">Home</a></li>
                        <li><a href="http://www.aplus.co.yu/feeds/">Feeds</a></li>
                        <li><a href="http://www.aplus.co.yu/archive/">Archive</a></li>
            </ul>
        </li>
        <li class="none" style="width:140px;">
        <a title="View all posts filed under NEW ARRIVALS" href="http://monique-relander.be/objects/new-arrivals/">New Arrivals</a></li>
        <li style="width:130px;">
        <a title="View all posts filed under Sold Gallery" href="http://monique-relander.be/objects/sold-gallery/">Sold Gallery</a></li>
        <li class="cat-item right">
        <a href="/contact">Contact</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-01T18:07:30+00:00Added an answer on June 1, 2026 at 6:07 pm

    The width of the li seems to be the same as the ul by default.

    Atleast based on my experiments here http://jsfiddle.net/dwCsW/

    If you remove the ul width it will be 100%, and by setting ul width the li will follow.
    So there must be something else in your code removing that.

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

Sidebar

Related Questions

I am making a drop down menu that is populated using an sql database.
I like using Dashcode for making quick little web apps, but it specifically targets
I'm making a website Using JSF and richfaces, but I need to do some
Currently i'm using this: edit creation migrate rake db:drop rake db:migrate rake db:seed but
I'm making an application that analyses one or more series of data using several
I was making a utility to quickly create CSS drop shadows, and realized that
Making a drop down list for my JSP and the values I'm entering won't
Making an adobe flex ui in which data that is calculated must use proprietary
Making UML sequence diagram in VS 2010RC I've observed that there is no activation
Making websites that appear correctly in IE is a big problem. Is there any

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.