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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:18:09+00:00 2026-05-21T14:18:09+00:00

I am building a drop down navigation bar, modeled after the one at NASA’s

  • 0

I am building a drop down navigation bar, modeled after the one at NASA’s homepage. At the time of writing it is not finished, so don’t expect it to look like it. My problem is that I have an inline list that contains normal lists. When I do not specify that the normal lists should fill 100% of the inline list item, they wrap at odd points. When I do specify it, however, I have found that I have to add !important to the declaration. I would like to find out why this is, because I generally avoid using !important, especially because I do not know what is necessitating it. I’ve included all of my code, because I have no idea what the problem is. The css may seem a little weird because I’m using a modified version of the markup here.

This is my html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dt>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Team 422 | Mech Tech Dragons</title>
        <link rel="stylesheet" type="text/css" href="standardLayout.css" />
    </head>
    <body>
        <div class="header">
            <img src="./MTDLogoHeader.png" alt="Team 422 Logo" class="team422Logo headerElement"/>
            <div class="navigation">
                <ul class="mainNavBar headerElement">
                    <li> <!--The odd-looking closing tags on the list items are intentional.  They fix cross-browser compatability issues-->
                        <div> <!--These divs are unfortunately non-semantic.  They allow the nvigation bar to resize properly-->
                            <h1>Home</h1>
                            <h2>Welcome</h2>
                        </div>
                    </li
                    ><li>
                        <div>
                            <h1>About</h1>
                            <h2>Our Vision</h2>
                        </div>
                    </li
                    ><li>
                        <div>
                            <h1>Team</h1>
                            <h2>Who We Are</h2>
                        </div>
                    </li
                    ><li>
                        <div>
                            <h1>Projects</h1>
                            <h2>What We Do</h2>
                        </div>
                    </li
                    ><li>
                        <div>
                            <h1>Media</h1>
                            <h2>Pics & Blog</h2>
                        </div>
                    </li
                    ><li>
                        <div>
                            <h1>Resources</h1>
                            <h2>Documents, Etc.</h2>
                        </div>
                    </li>
                </ul>
                <ul class="dropDownNav headerElement">
                    <li id="home">
                    </li
                    ><li id="about">
                        <ul>
                            <li>
                                <h1>About FIRST</h1>
                            </li
                            ><li>
                                <h1>About The Team</h1>
                            </li
                            ><li>
                                <h1>About This Site</h1>
                            </li
                            ><li>
                                <h1>FIRST Resources</h1>
                            </li>
                        </ul>
                    </li
                    ><li id="team">
                        <ul>
                            <li>
                                <h1>Structure</h1>
                            </li
                            ><li>
                                <h1>Subteams</h1>
                                <ul>
                                    <li>
                                        <h2>Mechanical</h2>
                                    </li
                                    ><li>
                                        <h2>Electrical</h2>
                                    </li
                                    ><li>
                                        <h2>Programming</h2>
                                    </li
                                    ><li>
                                        <h2>Non-Tech</h2>
                                    </li
                                    ><li>
                                        <h2>Spirit</h2>
                                    </li
                                    ><li>
                                        <h2>Awards</h2>
                                    </li>
                                </ul>
                            </li
                            ><li>
                                <h1>Members</h1>
                            </li
                            ><li>
                                <h1>Mentors</h1>
                            </li
                            ><li>
                                <h1>Sponsors</h1>
                            </li>
                        </ul>
                    </li
                    ><li id="projects">
                        <ul>
                            <li>
                                <h1>Robots</h1>
                                <ol>
                                    <li>
                                        <h2>2011- Geoffery</h2>
                                    </li
                                    ><li>
                                        <h2>2010- Ahab</h2>
                                    </li
                                    ><li>
                                        <h2>2009- Redemption</h2>
                                    </li
                                    ><li>
                                        <h2>More Robots...</h2>
                                    </li>
                                </ol>
                            </li
                            ><li>
                                <h1>Competition</h1>
                                <ul>
                                    <li>
                                        <h2>Schedule</h2>
                                    </li
                                    ><li>
                                        <h2>The Game</h2>
                                    </li
                                    ><li>
                                        <h2>The Rules</h2>
                                    </li
                                    ><li>
                                        <h2>Scouting</h2>
                                    </li
                                    ><li>
                                        <h2>Awards</h2>
                                    </li>
                                </ul>
                            </li
                            ><li>
                                <h1>Outreach</h2>
                                <ul>
                                    <li>
                                        <h2>FLL Competition</h2>
                                    </li
                                    ><li>
                                        <h2>Mentoring</h2>
                                    </li
                                    ><li>
                                        <h2>Service</h2>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </li
                    ><li id="media">
                        <ul>
                            <li>
                                <h1>Blog</h1>
                            </li
                            ><li>
                                <h1>Photos</h1>
                            </li
                            ><li>
                                <h1>Videos</h1>
                            </li
                            ><li>
                                <h1>In the News</h1>
                            </li>
                        </ul>
                    </li
                    ><li id="resources">
                        <ul>
                            <li>
                                <h1>Documents</h1>
                            </li
                            ><li>
                                <h1>Robot Manual</h1>
                            </li
                            ><li>
                                <h1>Calendar</h1>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>      
        </div>
    </body>
</html>

And my css:

body {
    background-color:#ffffff;
}

div.header {
    padding-left:150px;
    padding-right:0px;
    background-color:#003d00;
    margin:0px;
    height:160px;
}

div.header .headerElement {
    float:left;
    position:relative;
}

div.header img.team422Logo {
    height:150px;
    width:150px;
    right:150px;
    top:5px;
}

ul.mainNavBar {
    padding:0px;
    margin:0px;
    margin-left:-150px;
    border-top:2px solid #003d00;
    width:100%;
    clear:right;
}

ul.mainNavBar li {
    min-width:140px;
    height:75px;
    width:16.7%;
    padding:0px;
    margin-right:-2px;
    display:inline-block;
    position:relative;
}

ul.navBarMain li:hover {
    background-image:url('./mainNavBarBackgroundSelected.png');
    background-color:#006600;
}

ul.mainNavBar li:first-child {
    width:16.5%;
    margin-left:1px;
}

ul.mainNavBar li div {
    position:absolute;
    top:0px;
    border-left:2px solid #003d00;
    border-right:2px solid #003d00;
    margin:0px;
    padding-left:5px;
    margin-right:-2px;
    height:100%;
    width:100%;
    background-image:url('./mainNavBarBackground.png');
}

ul.mainNavBar li div:hover {
    color:#ffffff;
    background-image:url('./mainNavBarBackgroundSelected.png');
}

ul.mainNavBar li:first-child div {
    border:none;
}

ul.mainNavBar li div h1 {
    font-size:22px;
    margin-top:4px;
}

ul.mainNavBar li div h2 {
    font-size:14px;
}

ul.dropDownNav {
    margin:0px;
    padding:0px;
    width:100%;
}

ul.dropDownNav li {
    margin:0px;
    padding:0px;
    list-style-type:none;
}

ul.dropDownNav li ul {
    width:100%;
    margin:0px;
    padding:0px;
}

ul.dropDownNav li ul li {
    display:inline-block;
    vertical-align:top;
}

#about li {
    width:25%;
}

#team li {
    padding:0px;
    margin:0px;
    width:20%;
}

#projects li ul {
    width:33.3%;
    padding:0px;
    margin:0px
}

#projects li {
    padding:0px;
    margin:0px;
    width:33.3%;
}

#projects li:first-child {
    width:33.4%;
}

#media li {
    width:25%;
}

#resources li {
    width:33.3%;
}

#resources li:first-child {
    width:33.4%;
}

ul.dropDownNav li ul li h1 {
    font-size:20px;
}

ul.dropDownNav li ul li ol,
ul.dropDownNav li ul li ul {
    width:100% !important;
    padding:0px;
    margin:0px;
}

ul.dropDownNav li ul li ul li,
ul.dropDownNav li ul li ol li {
    position:relative;
    display:block;
    text-indent:5px;
    text-align:left;
    width:100% !important;
}

ul.dropDownNav li ul li ul li h2,
ul.dropDownNav li ul li ol li h2 {
    font-size:16px;
}

Thanks in advance!

  • 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-21T14:18:10+00:00Added an answer on May 21, 2026 at 2:18 pm

    This rule:

    #projects li ul {
        width:33.3%;
        padding:0px;
        margin:0px
    }
    

    has an ID selector #projects. This makes it a more specific selector, causing its width to overrule your ul.dropDownNav li ul li ul width unless you add !important.

    You can easily fix this and do away with the !important by forcing only the immediately-following level of ul children to have 33.3% width using the child combinator >:

    #projects > li > ul {
        width:33.3%;
        padding:0px;
        margin:0px
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When looking beyond the RAD (drag-drop and configure) way of building user interfaces that
Is there any IDE (like VS) with drag and drop support for building python
I'm looking for a javascript drop-down for a date range that allows the user
In my application, I have a recent files drop down menu. It will contain
I'm building a web-app that will allow users to drag and drop from a
I'm building a site that has one authentication system for both general users and
I'm building an Application and it needs to have a status bar item and
Building on How Do You Express Binary Literals in Python , I was thinking
Building a client-side swing application what should be notified on a bus (application-wide message
Building the same project (without any changes) produces binary different exe-files: some small regions

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.