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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:20:44+00:00 2026-05-23T02:20:44+00:00

<ul id=main> <li class=the-dropdown-link><a href=#>Main Link</a> <ul id=dropdown> <li>sdfsdf</li> <li>sdfsdf</li> </ul> </li> </ul> ul#main{

  • 0
<ul id="main">
  <li class="the-dropdown-link"><a href="#">Main Link</a>
    <ul id="dropdown">
      <li>sdfsdf</li>
      <li>sdfsdf</li>
    </ul>
 </li>
</ul>

ul#main{ margin:0; padding:0; list-style:none; float:right; width:100%;}
ul#main li.the-dropdown-link{float:left; width:140px; }
ul#main ul {position:absolute; display:none; padding:0;list-style:none;}
ul#main a{display:block;height:24px; width:140px;font-size: 14px; font-weight: 500; text-align: center; color: #ffffff; text-transform: uppercase; line-height: 26px;}

With this vertical dropdown menu I get gaps between the <li> in ie7. Doing my research I see that IE7 creates whitespace between </li> and <li>, however i’m generating my list using php and therefore cannot put all the <li> on the same line like everyone recommends.

I tried adding all the list elements into a variable and using:

$first_list = preg_replace('~>\s+<~', '><', $first_list);

to get rid of spaces, then echoing it.

I don’t know what to do.

  • 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-23T02:20:45+00:00Added an answer on May 23, 2026 at 2:20 am

    You should be able to stop PHP outputting the whitespace, and that’s the easiest solution.

    Otherwise, you can simply use:

    ul#main ul {
        font-size: 0
    }
    

    That will remove the gaps.

    You’ll have to set the font-size back, with something like ul#main ul li { font-size: 14px}.

    I successfully answered a similar question yesterday, check it out for more information and a demo:

    • Negative margin causes border to disappear in IE7 (be sure to check the comments)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider an ordinary 2 levels dropdown menu: HTML <ul class=menu> <li><a href=#>Main item 1</a>
I have a pretty standard CSS based dropdown menu. The main list is #mainNav
I have a main class in a program that launches another class that handles
I have a small Java test app in Netbeans where the main() class reads
I subclassed UIScrollView Then created an object of it in the main class. Added
I am trying to run a function of the main class, but even with
I'm creating a website with structure like this: class main { } class mysql
For my Java apps with very long classpaths, I cannot see the main class
In the interface required to implement a WCF service, I declare the main class
I have a question about the 'Event Dispatch Thread'. I have a Main class

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.