问题
Is the pixel size different for different browsers?
For example
<input type='button' class='button2' value='...' />
/*****CSS*****/
.button2{
width:120px;
}
overflows the button value in Chrome but doesn't so in Safari and Firefox. What am I doing is wrong?
回答1:
Pixels should be the same. If you investigate, you may find that the different browsers have different default values for things like margins, padding, text size, font face, etc. That's probably what's tripping you up (though I would note that popping that code into my own browsers does not produce any overflow.)
回答2:
- use css-reset
- different browsers render elements differently. Look your button in IE, you will be surprised :)
来源:https://stackoverflow.com/questions/6717179/pixel-size-for-different-browsers