Form padding differences in Firefox and Opera/Chrome/IE

前端 未结 5 730
时光取名叫无心
时光取名叫无心 2020-12-09 10:21

I\'m having a problem with the padding in my form on my website. If I\'ve set a height/width to a form element and then adds a padding to it. In all browsers I\'ve tried, ex

5条回答
  •  既然无缘
    2020-12-09 10:44

    http://necolas.github.com/normalize.css/

    /*
     * 1. Addresses box sizing set to content-box in IE 8/9.
     * 2. Removes excess padding in IE 8/9.
     * 3. Removes excess padding in IE 7.
     *    Known issue: excess padding remains in IE 6.
     */
    
    input[type="checkbox"],
    input[type="radio"] {
        box-sizing: border-box; /* 1 */
        padding: 0; /* 2 */
        *height: 13px; /* 3 */
        *width: 13px; /* 3 */
    }
    
    /*
     * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
     * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
     *    (include `-moz` to future-proof).
     */
    
    input[type="search"] {
        -webkit-appearance: textfield; /* 1 */
        -moz-box-sizing: content-box;
        -webkit-box-sizing: content-box; /* 2 */
        box-sizing: content-box;
    }
    

提交回复
热议问题