【问题标题】:Add custom CSS to angular material md-tooltip将自定义 CSS 添加到角度材质 md-tooltip
【发布时间】:2017-02-08 15:26:06
【问题描述】:

我正在做 angular material 项目,我在我的应用程序中使用了 md-tooltip,它工作正常。但是我想改变工具提示的外观。基本上我需要改变背景和文字颜色。我尝试添加一个自定义类和相同的样式。背景颜色应用于工具提示,但默认颜色位于此之上。我的代码如下。

HTML

    <button>
        <md-tooltip md-visible="$ctrl.favorites.showTooltip" class="ng-tool-tip">Favorites</md-tooltip>
        <i class="icon icon-sm" data-ng-class="$ctrl.showFavourite ? \'icon-favorite_fill\': \'icon-favorite\'"></i>
    </button>

CSS

    .ng-tool-tip{
        background-color:#354052;
        color:#fff;
        font-size: 13px;
        box-shadow:0px 0px 2px rgba(0,0,0,0.25);
        border-radius: 4px;
    }

【问题讨论】:

    标签: css angularjs tooltip material-design angular-material


    【解决方案1】:

    将“!important”添加到属性中的颜色

    .ng-tool-tip{
        background-color:#354052;
        color:#fff !important;
        font-size: 13px;
        box-shadow:0px 0px 2px rgba(0,0,0,0.25);
        border-radius: 4px;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-20
      • 2017-06-27
      • 1970-01-01
      • 2018-05-15
      • 1970-01-01
      • 2020-06-10
      • 2023-04-01
      相关资源
      最近更新 更多