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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:57:55+00:00 2026-06-01T19:57:55+00:00

i am trying to spread 4 items evenly across its parent container but for

  • 0

i am trying to spread 4 items evenly across its parent container but for some reason in ie7 the fourth item is pushed onto the next line. I don’t understand how that’s possible if I am specifying 25% width for each item. Here is my html/css:

<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <style>
        html, body, ul, li { padding:0; margin:0; }
        ul { list-style:none outside none; }
        ul li { float:left; height:40px; width:25%; }
        ul li a { display:block; height:20px; padding-top:20px; text-align:center; }
    </style>
</head>
<body>
    <div style="overflow:hidden">
        <ul>
            <li><a href="a">A</a></li>
            <li><a href="b">B</a></li>
            <li><a href="c">C</a></li>
            <li><a href="d">D</a></li>
        </ul>
    </div>
</body>
</html>

Seems to work fine in other browsers, but not ie7.

  • 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-01T19:57:56+00:00Added an answer on June 1, 2026 at 7:57 pm

    See this question. Basically IE rounds up when you use percentage widths so it’s possible to go over 100% where it will just bump your last item down. So to fix that you should either use 24% instead of 25% or just figure the right px width.

    It’s a bit lot less nice but you could change your code like so:

    CSS

     ul { list-style:none; position:relative; }
     li { position:absolute; top:0; height:40px; width:25%;}
     li.two {left:25%;}
     li.three {left:50%;}
     li.four {left:75%;}
    

    HTML

    <div> <!-- removed the overflow:hidden -->
        <ul>
            <li><a href="a">A</a></li>
            <li class="two"><a href="b">B</a></li>
            <li class="three"><a href="c">C</a></li>
            <li class="four"><a href="d">D</a></li>
        </ul>
    </div>
    

    which works for me in IE7 and Chrome

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

Sidebar

Related Questions

I'm trying to find a simple method of getting all the links spread evenly
We have 10 years of archived sports data, spread across separate databases. Trying to
I'm trying to maintain a web site spread across two domains with the same
I have a legacy product, spread across dozens of repositories. I'm currently trying to
I'm trying to figure out how to have SQLAlchemy classes spread across several files,
I'm trying to return some results spread over a rolling 12 month period eg:
Trying to parse an HTML document and extract some elements (any links to text
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
Trying to get comfortable with jQuery and I have encountered some sample code that
I'm trying to parse some data in a fixed format text file where each

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.