引用的XXX.CSS框架文件。
定义了 a标签, 他的全局样式我需要保留

  • a{
  • padding-bottom: 9px;
  • margin: 40px 0 20px;
  • border-bottom: 1px solid #e5e5e5;
  • margin-left: -30px;
  • padding-left: 30px;
  • }复制代码

但我在特定的位置需要 调用XXX样式 覆盖全局样式

目前我采用的笨办法就是 加个!important 定义最高优先级

  • a{
  • padding-bottom: 0px !important;
  • margin: 0px !important;
  • border-bottom: 1px solid #fff !important;
  • margin-left: 0px !important;
  • padding-left: 0px !important;
  • }复制代码

把每一个都覆盖过去。

有没有更好的办法?