但是,当呈现组件时,显示的颜色来自类(input-check">
<InputCheckbox class="input-checkbox100" id="ckb1" style="background: #918f8f;" name="remember-me" @bind-Value="CurrentCustomerSubmission.AcceptedTermsAndConditions" />
但是,当呈现组件时,显示的颜色来自类(input-checkbox100)。我正在尝试为这个1特定的元素覆盖它(所以不想把它添加到CSS中)。
发布于 2020-11-04 20:25:51
您可以在blazor组件中使用style标记并覆盖css类
例如:
@page "/"
<style>
.input-checkbox100{
background: #918f8f;
}
</style>
发布于 2020-11-05 11:02:58
在这里为你的类命名,我设置了ForInput:
<InputCheckbox class="input-checkbox100 ForInput" id="ckb1" name="remember-me" @bind-Value="CurrentCustomerSubmission.AcceptedTermsAndConditions" />
然后转到wwwroot,转到css,然后打开app.css,并在css中添加ForInput和您想要的背景。
.ForInput{
background: #918f8f;
}
https://stackoverflow.com/questions/64684117
复制相似问题