height bug... any 2011 solutions?

The Firefox line-height bug is a pain. In short, it prevents the manual setting of line-height on button elements through a browser style line-height: normal !important declaration that can't be reversed.

Now this is a huge pain, and in an era where hacking around browser-specific quirks is fortunately becoming decreasingly necessary, I'd hate to have to make an exception for Firefox of all browsers.

So my question now is whether there's anything I can do about it since the concession that the above article made that it was basically impossible.

Here's a fiddle to play around with: http://jsfiddle.net/hBLQ7/

Open in Firefox and Chrome and observe the difference.

So is there anything we can do in this day and age?


你可以设置按钮的高度,如果这是你以后的事情?


What about hacking it with top and bottom padding ?

CSS

button {
   padding: 25px 0;
}

Example

jsFiddle.


When testing your fiddle in firefox 9, your button actually renders with the same height as the span. Using inputs of type button/submit gives the problem you describe, however: Fiddle

I still haven't found a viable way around that issue..

One of the related bug reports is here.

链接地址: http://www.djcxy.com/p/6724.html

上一篇: 加速Java

下一篇: 高度错误...任何2011年解决方案?