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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:01:54+00:00 2026-05-11T08:01:54+00:00

I have a page where the infamous 3px extra vertical space (below each li

  • 0

I have a page where the infamous 3px extra vertical space (below each li element) is being rendered in IE7 on all my list items. I have a specific situation where I need text absolutely positioned within the li, so that its container can be set to a smaller width, & the text extends beyond the container. Here’s the code I’m using:

<style type='text/css'>  div { width: 160px; font: 8pt arial,helvetica,sans-serif; border: 1px solid #999; }   div ul { margin: 0; padding: 0; list-style: none; }    div ul li { width: 30px; height: 20px; margin: 0 0 4px; padding: 0; background-color: #c00; }     div ul li a { display: block; line-height: 20px; color: #000; text-decoration: none; }      div ul li a em { position: absolute; margin-left: 5px; } </style>  <div>  <ul>   <li><a href='#'><em>#1: premature brake wear</em></a></li>   <li><a href='#'><em>#2: squeaky brakes</em></a></li>   <li><a href='#'><em>#3: bad gas mileage</em></a></li>  </ul> </div> 

I’m looking for a solution that doesn’t involve an IE7-specific CSS hack, just for CSS purity’s sake. I’ve read that in a lot of cases, giving the containing elements hasLayout resolves most of these 3px extra height issues, but I haven’t been able to figure it out for this code.

In my app, I ended up applying a different margin-bottom for IE7 (1px rather than 4px) which works fine but just doesn’t seem right….

Test page here

Live app here

I’ve tried some of the standard fixes described on 456 Berea St & this page, but either I’m applying them incorrectly to my example, or it’s something else in the way my code is structured. Any suggestions for fixes or other ways to accomplish this layout?

  • 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. 2026-05-11T08:01:54+00:00Added an answer on May 11, 2026 at 8:01 am

    Try the following:

    <style type='text/css'>     div.test { width: 160px; font: 8pt arial,helvetica,sans-serif; border: 1px solid #999; overflow:hidden; }     div.test ul { margin: 0; padding: 0; list-style: none;}     div.test ul li { margin: 0 0 4px; }     div.test ul li a { display: inline-block; }     div.test ul li a { display: block; padding: 0 5px; line-height: 20px; color: #000; text-decoration: none; position: relative; z-index: 2; }     div.test ul li b {   background-color: #c00; height: 20px; width: 20px; position: absolute; display: block; z-index: 1; } </style>  <div class='test'>     <ul>         <li><b></b><a href='#'><em>#1: premature brake wear</em></a></li>         <li><b></b><a href='#'><em>#2: squeaky brakes</em></a></li>         <li><b></b><a href='#'><em>#3: bad gas mileage</em></a></li>     </ul> </div> 

    I couldn’t fix the problem you were having any cleaner than what you already have (the other fix is to float the LI’s and clear them) however, I am giving you an alternative way of doing this. I admit it’s the cleanest HTML, but it does neatly sidestep the problem.

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

Sidebar

Related Questions

I have a page that uses $(id).show(highlight, {}, 2000); to highlight an element when
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
I have a page where there is a column and a content div, somewhat
I have a page that is generated which inserts an HTML comment near the
I have a page using <ul> lists for navigation (Javascript changes the styling to
I have a page with many forms in panels and usercontrols, and a requiredfield
I have a page upon which a user can choose up to many different
I have a page with a Google Maps mashup that has pushpins that are
I have a page which spawns a popup browser window. I have a JavaScript
I have a page which does quite a bit of work and I don't

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.