按钮的背景颜色不会通过Tab键选择而改变

时间:2015-07-10 06:33:16

标签: javascript html css

当我通过鼠标指针悬停在按钮上时,背景颜色会发生变化,但是通过标签键背景颜色不会改变。

在html中

<style>
    .btn-primary {
        color: #fff;
        background-color: #227ab9;  
        border: none;
        cursor: pointer;
    }
    .BtnStyle {
        text-transform: uppercase;
        font-weight: 700;
        border-radius: 4px;
    }
    .btn-primary:hover,.btn-primary:focus,.btn-primary:active{
        background-color: #1a5e8e;

    }
</style>    

<table>
    <td><input id="txt" class="" type="text" value=""></td>
    <td id="go" class="BtnStyle btn-primary" >
        <button class="btn-primary"><i class="fa fa-chevron-save" aria-hidden="true"></i>test</button>
    </td>
</table>

2 个答案:

答案 0 :(得分:1)

public function upload(){
    $image = Input::file('image');
    $savepath = 'public/uploads/';
    $filename = $image->getClientOriginalName();
    Input::file('image')->move($savepath, $filename);
}

答案 1 :(得分:0)

您的代码对我来说很好!请看下面的代码。

如果您仍然遇到问题,请在jsFiddle中分享您的完整代码。

查看this

body {
    padding: 50px;
}
.btn-primary {
  color: #fff;
  background-color: #227ab9;  
}
.BtnStyle {
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 4px;
}
 .btn-primary:hover,.btn-primary:focus,.btn-primary:active{
    background-color: red;// #1a5e8e;

}


<table>
    <td><input id="txt" class="" type="text" value=""></td>
    <td id="go" class="BtnStyle btn-primary" >
                <button class="btn-primary"><i class="fa fa-chevron-save" aria-hidden="true"></i> Button</button>
   </td>
</table>
相关问题