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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:37:07+00:00 2026-06-14T13:37:07+00:00

Isolated test case (view in IE 7 or IE 8/9 in IE 7 mode)

  • 0

Isolated test case (view in IE 7 or IE 8/9 in IE 7 mode)

Viewing this page in IE 7 is causing my width value to be ignored. If you remove the padding value, the width is properly applied, but when you add in the padding, it causes the entire page to grow, and it treats the padding almost as margin. The larger the width of the page, the larger the blank area to the right of the element. I’ve been unable to find which bug this is, and, more importantly, how to fix it. Has anyone seen this and does anyone know a solution?

Things I’ve tried so far:

  • zoom fix
  • display: inline-block (recommended for double vertical padding issue)
  • It isn’t line-height (it’s a width issue…)

Screenshot of the issue:

This div should span the entire width of the page, and no more, but you’ll notice the scrollbar here:
IE 7 issue pre-scroll
And the result of scrolling to the right:
IE 7 issue post-scroll
This should not be there.

Examining the element in the browser tools shows the width to be incorrectly the full width of the page, instead of the full width minus the padding.

  • 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-14T13:37:08+00:00Added an answer on June 14, 2026 at 1:37 pm

    Disclaimer: I’ll ignore the functional requirement and your comments on the other answers and just concentrate on the concrete problem.


    This IE7 specific problem is caused by using an offset (e.g. top, right, bottom or left) on a relatively positioned element. If you offsets a relatively positioned element, then it will basically still retain the whole space of its original position. Note that this doesn’t happen when offsetting absolutely positioned element.

    Before the left offset is been applied, the relatively positioned element is due to its width and and the right padding completely out of the viewport and hence a horizontal scollbar will be generated. After the left offset is applied on the relatively positioned element, you’re basically leaving a space of the same size as the offset on the other side of the offset, still outside the viewport.

    A bit sane webbrowser will during redrawing however discover that there’s nothing visible outside the viewport and hence hide the scrollbar again. IE7, however, isn’t that smart enough and retains the scrollbar.

    After all, using left offset was technically been the wrong solution. You should in first place have used margin-left instead of left. Unlike the offset, the margin doesn’t leave an empty space on the original position, but really pushes the whole element to the desired position.

    So, here’s how your script is been fixed:

    $('#el').css({
        'width': document.body.scrollWidth - 200,
        'padding-right': 200,
        'margin-left': (-1 * (document.body.scrollWidth - 322) / 2) - 1
    });
    

    By the way, I wonder how that float: left; makes sense in this construct wherein you apparently want to simulate a 100% width. It’ll probably be for other purposes not visible in the concrete example.

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

Sidebar

Related Questions

I've isolated a little test case of IE7's z-index bug, but don't know how
Here is a minimal test case I've isolated: <?php class What { public $foo
I've isolated the behaviour into the following test case. I'd be grateful to anyone
I have isolated my problem in this fiddle http://jsfiddle.net/xYphz/ It uses the root model
For testing I have 1 isolated page - no masters, controls, …. My sessions
Suppose I have this integration test class TestClass(unittest.TestCase): @classmethod def setUpClass(cls): cls.key = '123'
I have isolated a problem we are running into down to a simple test:
I have created a text file in isolated storage. Now when i test it
I have a helper that accesses request.fullpath . Within an isolated helper test, request
I have fully isolated this problem to a very simple play app I think

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.