html - 如何更改 ng-required 中星号符号的颜色

标签 html css angularjs angular-material

我正在使用 Angular Material 。我想要根据需要选择框。使用 ng-required 后,选择框的标签显示一个灰色的星号符号。我想要这个星号符号为红色。但我无法修复它。谢谢

<md-input-container flex="50">
    <label>Favorite Color</label>
    <md-select name="favoriteColor" ng-model="favoriteColor" required>
      <md-option value="red">Red</md-option>
      <md-option value="blue">Blue</md-option>
      <md-option value="green">Green</md-option>
    </md-select>
  </md-input-container>

最佳答案

您可以使用此 CSS 规则:

md-select .md-select-value span:first-child:after {
  color:blue !important;
}

关于html - 如何更改 ng-required 中星号符号的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45346421/

相关文章:

javascript - 将主页上的 anchor 标记链接到特定选项卡

javascript - 在 ionic 项目中注入(inject)自定义 JS 文件

javascript - 在不使用 ng-bind-html 的情况下在范围变量中绑定(bind) html 内容

javascript - 为什么此 JavaScript 无法正确更新输入值?

javascript - 如何选择(突出显示)和复制有序列表编号

html - 内联 CSS 元素没有空格

php - Internet Explorer z-index 不适用于打开的 Flash 图表

javascript - 在javascript中按下按钮时加载图像

javascript - Angular : Directive: How to pass require form AND controller to link function

javascript - JQuery 检查是否需要输入