【问题标题】:How do I style the Woocommerce checkout select option?如何设置 Woocommerce 结帐选择选项的样式?
【发布时间】:2021-08-28 09:15:55
【问题描述】:

我正在尝试更改 Woocommerce 结帐页面中选择(下拉)字段的样式。我将它与 DIVI 主题一起使用。

默认情况下,选择字段的高度与其他字段不同:

我设法在 css 中通过使用这个类上的填充找到了执行此操作的部分:

.woocommerce-input-wrapper .select2-container--default .select2-selection--single

但随后选择选项和箭头不在中间:

如果我在这里减小行高,我可以移动字段的内容:

.select2-container--default .select2-selection--single .select2-selection__rendered

但是如果我减少太多,文字会被截断

如何将字段的内容正确移动到中间? 谢谢

【问题讨论】:

标签: css woocommerce jquery-select2


【解决方案1】:

试试这个。将以下代码中的 40px 更改为您想要的值。在 windows、google chrome 中测试和工作。

.select2-container .select2-selection--single{
    height: 40px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow{
    height: 40px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered{
    line-height: 40px !important;
}

【讨论】:

  • 乐于助人:)
猜你喜欢
  • 2017-12-30
  • 1970-01-01
  • 2014-11-10
  • 1970-01-01
  • 2011-11-04
  • 2011-08-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多