为Select元素添加了样式,但现在有双切换按钮

时间:2018-04-20 09:45:00

标签: html css

我已经为我的select元素添加了css样式。但是,正如您在下面看到的那样,元素现在有一个白色切换按钮和一个黑色切换按钮。我该怎样摆脱黑色的?

enter image description here



.styled-select {
  background: url(http://i62.tinypic.com/15xvbd5.png) no-repeat 96% 0;
  height: 29px;
  overflow: hidden;
  width: 240px;
}

.semi-square {
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}

<select class="styled-select yellow semi-square" (change)="getLocations()" id="interest">

  <option value="default">Select your interest</option>

  <option value="movie_theater">Movie Theaters</option>

  <option value="movie_rental">Movie Rental</option>

</select> within

<select class="styled-select yellow semi-square" (change)="getLocations()" id="distance">

  <option value="2500" selected>2,5</option>

  <option value="5000">5 </option>

  <option value="10000">10</option>

  <option value="20000">20</option>

</select> kilometers <br />
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:4)

-webkit-appearance: none; 添加到select

请参阅this

.styled-select {
      background: url(http://i62.tinypic.com/15xvbd5.png) no-repeat 96% 0;
      height: 29px;
      overflow: hidden;
      width: 240px;
      -webkit-appearance: none;
      -moz-appearance: none;
  }

  .semi-square {
      -webkit-border-radius: 5px;
      -moz-border-radius: 5px;
      border-radius: 5px;
  }
<select class="styled-select yellow semi-square" (change)="getLocations()" id="interest">

    <option value="default">Select your interest</option>

    <option value="movie_theater">Movie Theaters</option>

    <option value="movie_rental">Movie Rental</option>

</select> within

<select class="styled-select yellow semi-square" (change)="getLocations()" id="distance">

    <option value="2500" selected>2,5</option>

    <option value="5000">5 </option>

    <option value="10000">10</option>

    <option value="20000">20</option>

</select> kilometers <br />

相关问题