如何更改 Buefy 的 Select 的背景?

how to change the background of Buefy's Select?

我是一名初学者编码员,我开始使用 Bulma 和 Buefy 工作了 2 周,我一直在努力改变这个 select 的背景颜色 => Select Button,我已经尝试过

.select select{
background color : red;
}

select{
background color : red;
}

但是没有成功,有人可以帮助我吗?

我的代码如下:

      <div class="selectItem">
        <span>Ship to End User</span>
        <b-select placeholder="Ship to End User" size="is-small">
          <option value="Test">Test</option>
        </b-select>
      </div>

备注: 我正在使用 Bulma 和 Buefy,所以 Sass 可用

  • 在您的 Sass 文件中,您可以像这样为输入字段(包括 select)指定自定义颜色:

$input-background-color: red;

参考:https://bulma.io/documentation/form/input/#variables

  • 如果您只想更改 select 元素的背景颜色,而不是修改 Sass 文件,您可以使用此 CSS 配置:
<style>
span.select.is-large > select {
  background-color: blue;
}
</style>