样式化选择下拉标记

时间:2015-04-27 03:07:39

标签: html css

我选择了一个标签,我想知道我是否可以占据右边的空间,箭头在哪里

http://codepen.io/anon/pen/Pqwpdm

<header class="navbar">
  <div class="navbar__container">
    <select class="navbar__select">
      <option class="navbar__option">Janeiro, 2015</option>
      <option class="navbar__option">Fevereiro, 2015</option>
      <option class="navbar__option">Março, 2015</option>
      <option class="navbar__option">Abril, 2015</option>
      <option class="navbar__option">Maio, 2015</option>
      <option class="navbar__option">Junho, 2015</option>
      <option class="navbar__option">Julho, 2015</option>
      <option class="navbar__option">Agosto, 2015</option>
      <option class="navbar__option">Setembro, 2015</option>
      <option class="navbar__option">Outubro, 2015</option>
      <option class="navbar__option">Novembro, 2015</option>
      <option class="navbar__option">Dezembro, 2015</option>
    </select>
  </div>
</header>


.navbar__select {
  float: right;
  background: #C9D3DD;
  font-size: 17px;
  border: 0;
  border-radius: 0;
  -webkit-appearance: none;
  padding: 5px;
}

谢谢! :)

1 个答案:

答案 0 :(得分:2)

这个问题has already been asked.

回顾一下:

  • 使用-moz-appearance: none禁用Firefox中的下拉箭头
  • 使用-webkit-appearance: none禁用Webkit浏览器(例如Google Chrome)中的下拉箭头
  • 在可用于Internet Explorer中下拉箭头的psudo类上设置display: none::-ms-expand