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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:25:52+00:00 2026-05-22T12:25:52+00:00

Browsers have default padding for HTML page. For example my FF sets 8px margin

  • 0

Browsers have default padding for HTML page.
For example my FF sets 8px margin of body element by default.
I can calculate default width padding for HTML page using

jQuery(window).width() - jQuery('body').innerWidth();

due to body element spans all available browser viewport width.
Also I have other browser which sets different values for width and height padding.
Could you propose way to calculate height padding?
Previous code will not work due to body inner height will return actual page content height and will not span all available height.

  • 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-22T12:25:53+00:00Added an answer on May 22, 2026 at 12:25 pm

    Do you really need to calculate the padding? The padding is defined in an element’s css setting for padding and margin.

    You can get these easily in jQuery:

    // Select the body element.
    var bodyElement = $('body');
    
    // Get the paddings
    var widthPadding = bodyElement.css('padding-left') + bodyElement.css('padding-right');
    var heightPadding = bodyElement.css('padding-top') + bodyElement.css('padding-bottom');
    
    // Get the margins
    var widthMargin = bodyElement.css('margin-left') + bodyElement.css('margin-right');
    var heightMargin = bodyElement.css('margin-top') + bodyElement.css('margin-bottom');
    

    You can remove the default user-agent (i.e. the browser’s) settings by defining in your css file:

    body {
        margin: 0;
        padding: 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a header within the following html page and I can't get the
Related: How can I locate the default style sheet for a browser? Most HTML
Let's say within the <body> of my web page, all I have is a
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
I have my web browsers set to save what I type into text boxes
I have a fairly standards compliant XHTML+CSS site that looks great on all browsers
I have a page which spawns a popup browser window. I have a JavaScript
Below is a complete html page that shows the problem. The myDiv should be
Hi everyone i have a problem like this. For example im in http://localhost/Search.aspx I
I have an html table in which I am placing images side by side

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.