【问题标题】:Padding differences in anchor element and input element with same style具有相同样式的锚元素和输入元素的填充差异
【发布时间】:2012-01-11 11:42:27
【问题描述】:

我有下一个输入和锚元素:

<input type="submit" class="button" name="add" value="Button 1" />
<a class="button" href="cpanel.php">Button 2</a>

css 是:

 input, textarea, select, button 
 {font-size: 100%;font-family: inherit;margin:0;padding:0;}  

.button{
    border: 1px solid #9B9B9B;  
    background-color: #DADADA;
    padding: 0; 
    margin: 0 20px 5px 0;   
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    -khtml-border-radius: 5px;  
    cursor: pointer;
 }

问题是 Firefox 显示两个按钮的填充不同:

我使用了一个重置​​ css 代码并在 body 中定义了一个 line-height 属性。

谢谢。

【问题讨论】:

    标签: html css firefox input anchor


    【解决方案1】:

    尝试:

    input::-moz-focus-inner
    { 
        border: 0;
        padding: 0;
    }
    

    【讨论】:

      猜你喜欢
      • 2012-11-23
      • 2012-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-14
      • 1970-01-01
      • 2010-10-20
      • 1970-01-01
      相关资源
      最近更新 更多