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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:51:08+00:00 2026-05-26T18:51:08+00:00

If I have an element set to display:none . Firebug tells me the element

  • 0

If I have an element set to display:none.

Firebug tells me the element has:
margin-top/bottom: 20px
padding-top/bottom: 20px
height: -22px

If the element is set to display:block height changes to this:

height: 73px

I need to retrieve the -22px via Jquery, but I’m always getting the 73px no matter what display is set to. Is there a way to get the -22px?

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-05-26T18:51:09+00:00Added an answer on May 26, 2026 at 6:51 pm

    Don’t use jQuery. If you have the element (maybe with getElementById()), just get its offsetHeight. That should be 0px – there’s no such thing as negative height, I think that’s just Firebug taking the offsetHeight and subtracting margin/border/padding…

    I’m almost certain that jQuery will assume you want the actual height when visible, so it’ll do something like “make it visible, get the height, make it invisible again”.

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

Sidebar

Related Questions

When you set an html element to have display: none , the content inside
I have two select inputs set to display:none. Based on change() in another element
I have this set of code that adds a display:none css class to a
I have a sprite image set as the background of an element on my
I have a set of selected elements in jQuery: <div class=element></div> <div class=element></div> <div
Do they set display: none or visibility: hidden ? I'm pretty sure display: none
I have a listview and want to change its style to display:none on pageload
I have set up the DOM Element (hidden div) exmplae of nyroModal on my
I have seen people set an element's style to: element{ position:absolute; left:-10000px; } rather
link: [removed by author] I have space in bottom of site (~15px). Firebug and

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.