CSS: Size of buttons in Chrome is different than Firefox

后端 未结 8 745
名媛妹妹
名媛妹妹 2021-01-31 10:18

I have the following HTML code:


...
...
8条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 11:01

    To get the same size on both browser you have to set the same initial values to all the CSS elements, like a reset.

    This is how I fixed the problem: put this at the beginning of your css file

    body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td, a
        {
          margin-top: 0px;
          margin-right: 0px;
          margin-bottom: 0px;
          margin-left: 0px;
          padding-top: 0px;
          padding-right: 0px;
          padding-bottom: 0px;
          padding-left: 0px;
          border-top-width: 0px;
          border-right-width-value: 0px;
          border-bottom-width: 0px;
          border-left-width-value: 0px;
        }
    

    Now you have to fix some aspect changes on your page but it will look almost the same on all the browsers.

提交回复
热议问题