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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:11:02+00:00 2026-06-09T16:11:02+00:00

My drop down menu works perfect in XML and not in HTML. Please view

  • 0

My drop down menu works perfect in XML and not in HTML. Please view this fiddle for a visual presentation: http://jsfiddle.net/H8FVE/9/
If you hover your mouse over the MORE button, you will see that the drop down aligns fine. The code I use for the drop down bit is:

<moretopbar>
<ul>
    <li class="mgames"><a href="" style="border-bottom:9px solid #e34328">Games</a></li>
    <li class="mliterature"><a href="" style="border-bottom:9px solid #2c8f83">Literature</a></li>
    <li class="marts"><a href="" style="border-bottom:9px solid #cc226a">Arts</a></li>
    <li class="mcontact" style="background:none;"><a href="" style="border-bottom:9px solid #9395aa">Contact</a></li>
</ul>
</moretopbar>

And some CSS:

#mega div moretopbar {
    clear: both;
    float: left;
    position: relative;
    margin-left:1px;
    margin-right:1px;
    width: 495px;
    height: 74px;
    background-image: url(images/morebgwide.png);
    background-size:495px 74px;
    background-repeat:no-repeat;
}

I tried to change the <moretopbar> to <div id="moretopbar"> but it messed up the drop down completely.

Why is that? And how should I fix it so that I use HTML only? Feel free to update the fiddle if you choose to answer: http://jsfiddle.net/H8FVE/9/

Before you choose to answer I should note two things. Firstly, I am not familiar with XML, the above is a coding mistake that randomly worked for me (and someone pointed out it was XML), and secondly, is there a reason of why I shouldn’t use it this way? For instance compatibility 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-06-09T16:11:04+00:00Added an answer on June 9, 2026 at 4:11 pm

    Your HTML is totally invalid. You are opening a lot of divs and not closing them all. That is why your design breaks when you introduce one more div.

    Please fix your HTML. You can use W3c’s Online Validator to see problems with your markup. Make writing valid HTML your habit, otherwise expect to get “strange” errors like this.

    In this fiddle, I made the following changes:

    • Moved the ID to your <ul> and got rid of <moretopbar>:

      <ul id="moretopbar">
      
    • Changed the selector to: #mega div #moretopbar.

    It “works” because the ID is now on an ul, not a div – as I already mentioned, the browser cannot really identify which div is which because of the lack of closing tags. Unless you fix this problem you are very very likely to see other strange bugs with your current divs.


    Edit: Also the following CSS rules need to be more specific than simply saying div:

    #mega div {...}
    #mega li.dif:hover div {...}
    

    For example you can use a specialdiv class on the div you mean these rules for, and use .specialdiv instead of div in the rules.

    Working jsFiddle Demo

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

Sidebar

Related Questions

I have a drop down menu that looks like this: It works fine, but
I'm using this for displaying a drop down menu. It works in all browsers
Fiddle here: http://jsfiddle.net/emJcx/1/ I have a drop down menu that is a simple show
I have designed a 2-Level CSS drop down menu. Everything works perfect except only
I'm trying to make a drop-down menu, works fine in firefox It does not
Ok i have this drop down menu script. It works fine when all the
I setup a jquery dropdown menu that works perfect. It drops down when a
I have got a drop down menu which works fine but i want to
I've got a css-based horizontal drop down menu that works perfectly well, but I'm
The below code removes certain values from a drop down menu. It works fine

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.