我想将必填字段符号(星号)的颜色更改为红色。我正在使用 Mud-Blazor。我使用下面的代码尝试了它。 这是我用于星号以红色显示的代码。
<style>
.mud-input-required::before {
content: "*";
color: red;
margin-right: 2px;
}
.mud-label {
display: flex;
align-items: center;
}
</style>
<MudTextField @bind-Value="HelperText" Class="red-asterisk-required" Label="With Helper" Variant="Variant.Outlined" />
<br>
<MudTextField @bind-Value="HelperText" Label="With Helper" Variant="Variant.Outlined" />
<style>
.red-asterisk-required .mud-input-label::after {
content: " *";
color: red;
}
</style>
@code {
public string HelperText { get; set; }
}