ElementUI el-popover弹框背景色设置

1.el-popover样式由于使用了 absolute 属性,导致脱离了节点,所以在父级元素使用class无法进行权重处理来修改其样式,解决方式如下:通过popper-class实现样式处理,避免全局样式污染

javascript 复制代码
// html
<el-popover
      placement="right"
      popper-class="device-popover"
      width="130"
      trigger="click">
          <div>
               Devices with the same IP address as the user
          </div>
</el-popover>

//css 
.device-popover{
   background-color: #ffdf25 !important;
   border-color: #ffdf25 !important;
}
.device-popover .popper__arrow::after{
   border-right-color:#ffdf25 !important;
}
相关推荐
非优秀程序员4 小时前
第10章 千团出世|《互联网产品恩仇录》
前端
非优秀程序员4 小时前
第11章 小高在对面|《互联网产品恩仇录》
前端
非优秀程序员4 小时前
第14章 只剩美团|《互联网产品恩仇录》
前端
非优秀程序员4 小时前
第09章 老乡何必为难老乡|《互联网产品恩仇录》
前端
非优秀程序员5 小时前
第03章 三大门户,烽烟起于瀛海威|《互联网产品恩仇录》
前端
非优秀程序员5 小时前
第04章 邮箱大战,163 与 QQ 的暗战|《互联网产品恩仇录》
java·vue.js·架构
曦樂~9 小时前
【Web Development】02 CSS
前端·css
风骏时光牛马9 小时前
后端服务接口开发与数据逻辑处理
前端
东鹏特饮9 小时前
经典打砖块(Breakout)游戏
前端·css·css3
IT_陈寒9 小时前
Vite的HMR把我整不会了:一个生产环境的热更新坑
前端·人工智能·后端