开发者

Computed height different from specified height

开发者 https://www.devze.com 2023-03-15 20:50 出处:网络
While making a button on my website, I was trying to draw inspiration from the search button at www.google.com.

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 eleme开发者_Go百科nt 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号