如何使切换按钮透明

时间:2017-02-07 13:11:47

标签: html css twitter-bootstrap

enter image description here

如何在悬停时使切换按钮透明?

 header .navbar-toggle {
    border: none;
}
.navbar-default .navbar-toggle .icon-bar {
    background-color: #ffffff;
}
header .navbar-header button {
    color: #ffffff;
    background-color: transparent;
}

我使用bootstrap。提前谢谢。

2 个答案:

答案 0 :(得分:0)

使用此

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">


<style>
  .navbar-header .navbar-toggle,
  .navbar-header .navbar-toggle:focus,
  .navbar-header .navbar-toggle:hover {
    background-color: transparent;
    border-color: transparent;
  }
</style>


<div class=container>
  <nav class="navbar navbar-default">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Brand</a>
      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      </div>
      <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
  </nav>
</div>

答案 1 :(得分:0)

使用透明属性

header .navbar-toggle:hover {
    background-color: transparent;
}