【element】select-修改背景色、字体颜色、宽高等样式

效果:

前提:

需要给el-select的父元素添加类名

.select {
    &::v-deep {
        .el-select {
            // 1.修改边距
            margin-left: 9px;

            .el-input.el-input--suffix {
                // 2.修改背景颜色、字体颜色、边框、宽高
                .el-input__inner {
                    background: rgba(0, 119, 239, 0.4) !important;
                    color: #fff;
                    border: 1px solid #057DD9;
                    height: 30px;
                    width: 95px; 
                }
                
                // 符号的位置会错乱,进行修正(水平)
                .el-input__suffix-inner {
                   position: absolute;
                   left: -65px;
                }
            }

                // 符号的位置会错乱,进行修正(垂直)
            .el-select__caret.el-input__icon.el-icon-arrow-up {
              line-height: 30px;
            }
        }
    }
}

猜你喜欢

转载自blog.csdn.net/Weiqian_/article/details/128074524