Pixel size for different browsers

走远了吗. 提交于 2019-12-12 01:28:35

问题


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:


  1. use css-reset
  2. different browsers render elements differently. Look your button in IE, you will be surprised :)


来源:https://stackoverflow.com/questions/6717179/pixel-size-for-different-browsers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!