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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:37:23+00:00 2026-05-26T10:37:23+00:00

When I have a scrollbar on my page and I apply overflow:hidden , it

  • 0

When I have a scrollbar on my page and I apply overflow:hidden, it hides the scrollbar, but the page moves to the side by a few pixels. I would like it to stay intact. I tried to apply position:absolute and left:10px, but it didn’t work.

Any ideas on how to make it stay intact?

basically, all of this is done for the modal dialogs to appear with the main page content including scrollbars locked so the user can only scroll the modal dialog.

the browser I try this in is older IE versions and the code for opening the dialog is this:

 if ((ua.msie && ua.version.slice(0, 3) == "7.0") || (ua.msie && ua.version.slice(0, 3) == "6.0")) {
    $('body').css('overflow', 'hidden');
    $('html').css('overflow-y', 'hidden');
}

Everything works perfect except that the page content moves to the right side a little bit when the scrollbar gets hidden.

  • 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-26T10:37:24+00:00Added an answer on May 26, 2026 at 10:37 am

    Try to add some padding to the body or the main content div.

    Something like

    body{
        padding-right:10px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery scrollbar in a static html page. The code works fine
I have created JTextpane and inserted components inside textpane (components like Jtextarea). (vertical scrollbar
I have an application that I would like to embed inside our companies CMS.
Possible Duplicate: iPad iframe scrollbar problem I have an iframe inside a page and
I have an IE8 buggy horizontal scrollbar problem, similar to this: DIV with overflow:auto
i have a webpage, scrollbar is not needed but still i get a scroll
I have problem with vertical scrollbar on my page. I have lot of items
I have a div (sub area of page with scroll bar) that has some
I have a dataTable and I am using scrollBar if the records exceed ,lets
I have a div in which I need a permanent vertical scrollbar. Sometimes the

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.