【问题标题】:Is there anyway to style select tag? [duplicate]无论如何样式选择标签? [复制]
【发布时间】:2014-02-27 22:02:40
【问题描述】:

我想改变箭头的大小和颜色。有没有办法用 css 做到这一点?

这是我的代码;

  <div class="gecesayisi">
        <p>Nights</p>
        <select>
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
              <option value="4">5</option>
         </select>

  </div>

Select 的背景是黑色的。在 chrome 中我看不到箭头,但在 mozilla 中我可以顺便说一句。

【问题讨论】:

  • select2 是你的朋友。
  • 子弹?什么子弹? select/option 元素没有项目符号。
  • 你说的是箭头吗?
  • 是的,我说的是箭头

标签: html css


【解决方案1】:

有多种样式设置方法,但取决于浏览器。

请联系look at this article 了解更多信息。

.styled-select select {
   background: transparent;
   width: 268px;
   padding: 5px;
   font-size: 16px;
   line-height: 1;
   border: 0;
   border-radius: 0;
   height: 34px;
   -moz-appearance: none;
   -webkit-appearance: none;
}

.styled-select {
   width: 240px;
   height: 34px;
   overflow: hidden;
   background: url(new_arrow.png) no-repeat right #ddd;
   border: 1px solid #ccc;
}

【讨论】:

    【解决方案2】:

    将以下行添加到您的 css 文件中。

    select{font-size:xx px; background-color:#xxx}
    

    【讨论】:

      【解决方案3】:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-03-04
        • 1970-01-01
        • 1970-01-01
        • 2015-09-09
        • 1970-01-01
        • 1970-01-01
        • 2011-10-04
        • 1970-01-01
        相关资源
        最近更新 更多