Button Size Inheritance Mystery
Solution 1:
The problem is that some browsers decide to give to input
elements a different font-family
. Try to add a font-family
property to the .button
class, so that the browser won't set his own depending on the html element.
The same goes for the font-size. I agree on what you say about the font: inherit
in the Meyer reset, but somehow (and i don't know why, we should ask some browser behaviour expert), the browser add it's own built-in css after all your custom css for certain elements. To prevent this, you need to explicitly tell the browser how to render certain stuff. You may ask "which stuff? i can't write every single css property for a class" and you're right.
What i suggest to do is, with the help of the browser console, to check which are the properties being overwritten by the browser itself, and, once indentified, to write them in your css.
Check this image for an example with the Chrome console:
- Select the element you want to analyze
- Go on the "computed tab". This will tell you what are the real css properties applied for that element
- You can filter all the properties by entering a text there
- Notice that
13.3333px
is a value that comes from theuser agent stylsheet
(default behaviour of the browser) and it is overwriting your own css. Edit your css accordingly to that.
Post a Comment for "Button Size Inheritance Mystery"