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

  • Home
  • SEARCH
  • 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 8317503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:37:32+00:00 2026-06-08T21:37:32+00:00

Possible Duplicate: issue with CSS media queries(scrollbar) So, Firefox includes the scrollbar width in

  • 0

Possible Duplicate:
issue with CSS media queries(scrollbar)

So, Firefox includes the scrollbar width in its window width calculation, where was Webkit does not. This results in an inconsistency between browsers.

Now, I know that technically Firefox is following the spec by calculating the scrollbar as part of the window width, but this seems really counter-intuitive to me. After all, mobile devices don’t have scrollbars, and scrollbar width varies from browser to browser / OS to OS.

Is there anything I can do to prevent Firefox from including the scrollbar width? Perhaps a piece of jQuery that will allow my media queries to fire correctly across browsers?

Thanks.

  • 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-08T21:37:34+00:00Added an answer on June 8, 2026 at 9:37 pm

    If you are just using media queries, then the offset from the sidebar won’t make any difference between browsers.

    If you are trying to use jQuery with a media query however, you may run into some small problems as the widths returned in jQuery are consistent, and the offset will then show.

    To fix this you simply need to calculate the offset of the sidebar in firefox browsers and subtract that from whatever point you wanted to syncronize at. i.e.

    var scrollBarWidth = 0;
    if ($.browser.mozilla)
      scrollBarWidth = window.innerWidth - jQuery("body").width();
    

    Then later on when you specify the synchronization…

    if ($(window).width() < mediaQueryWidth - scrollBarWidth) {
      //act to do along with the media query
    }
    

    Hope this was helpful

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

Sidebar

Related Questions

Possible Duplicate: Css z-index problem I have an issue where one image is infront
Possible Duplicate: Browser Independence issue Code Working for IE but not for Firefox and
Possible Duplicate: How do I get this CSS text-decoration issue to work? I'm using
Possible Duplicate: Why does InputStream#read() return an int and not a byte? Issue regarding
Possible Duplicate: table cell width issue I have a table set up as <html>
Possible Duplicate: What does <link> tag do besides including stylesheets? <link rel=stylesheet type=text/css href=example.css
Possible Duplicate: Issue while saving image using savefiledialog I use windows forms in C#.
Possible Duplicate: Encoding issue: £ pound symbol appearing as <?> symbol I am doing
Possible Duplicate: Floating point issue in C #include<stdio.h> main() { int a,b; float f;
Possible Duplicate: multiple UIAlertView issue I`am beginner ios developer. And I faced with 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.