Vivek Pandey
Vivek Pandey

Reputation: 3555

Computed height different from specified height

While making a button on my website, I was trying to draw inspiration from the search button at www.google.com.

So, using google chrome as the browser, I went to www.google.com, right clicked on the "Google Search" button and selected "Inspect Element" option. I saw that the button element has the class "lsb" and css specifies a height of 30px for an element of this class. This specification has not been overridden by another statement (or else chrome would tell me so). Still, when I look at the computed value, I see that the height is 43px, rather than 30px.

So, I am wondering, what is causing this increase in the height of the element?

Upvotes: 4

Views: 2381

Answers (1)

Vivek Pandey
Vivek Pandey

Reputation: 3555

The problem was that I had set zoom scale for google.com to 144%. So, what would have been 30px by default, became 30 * 1.44 = 42px.

Once I set the zoom scale to 100%, the discrepancy vanished.

Upvotes: 3

Related Questions