gpt4 book ai didi

javascript - 除了 Angular-Material md-checkboxes 之外,默认的浏览器复选框也出现了

转载 作者:太空狗 更新时间:2023-10-29 19:36:03 25 4
gpt4 key购买 nike

enter image description here我在我的 Angular 2 应用程序中使用了 Angular Material 元素,在我使用 md-checkboxes 的一个部分中,我注意到在 Chrome 中,md-checkboxes 的 UI 以及看起来像是默认浏览器复选框正在显示。如何禁止显示默认的浏览器 UI 复选框?

<md-checkbox class="request-option" [checked]="hasBeenRequested()"
(change)="onOptionSelected($event, 'ct')">Consulting
</md-checkbox>

以下是根据浏览器应用的样式:

element.style {
}
default-theme.css:205
.chart-content .scroll-panel * {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
<style>…</style>
.mat-checkbox-input {
bottom: 0;
left: 50%;
}
<style>…</style>
.cdk-visually-hidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
text-transform: none;
width: 1px;
}
default-theme.css:195
.chart-content * {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
default-theme.css:413
input {
font-size: 14px;
padding: 8px;
outline: none;
}
user agent stylesheet
input[type="checkbox" i] {
-webkit-appearance: checkbox;
box-sizing: border-box;
}
user agent stylesheet
input[type="radio" i], input[type="checkbox" i] {
background-color: initial;
cursor: default;
margin: 3px 0.5ex;
padding: initial;
border: initial;
}
user agent stylesheet
input {
-webkit-appearance: textfield;
background-color: white;
-webkit-rtl-ordering: logical;
cursor: text;
padding: 1px;
border-width: 2px;
border-style: inset;
border-color: initial;
border-image: initial;
}
user agent stylesheet
input, textarea, select, button {
text-rendering: auto;
color: initial;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
margin: 0em;
font: 400 11px system-ui;
}
user agent stylesheet
input, textarea, select, button, meter, progress {
-webkit-writing-mode: horizontal-tb;
}

我的“计算”选项卡显示了这一点:

background-color: rgba(0, 0, 0, 0);
border-bottom-color: rgb(0, 0, 0);
border-bottom-style: none;
border-bottom-width: 0px;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(0, 0, 0);
border-left-style: none;
border-left-width: 0px;
border-right-color: rgb(0, 0, 0);
border-right-style: none;
border-right-width: 0px;
border-top-color: rgb(0, 0, 0);
border-top-style: none;
border-top-width: 0px;
bottom: 0px;
box-sizing: border-box;
clip: rect(0px 0px 0px 0px);
color: rgb(0, 0, 0);
cursor: default;
display: block;
inline-blockinput, textarea, select, buttonuser agent stylesheet
font-family: system-ui;
font-size: 14px;
font-stretch: 100%;
font-style: normal;
font-variant-caps: normal;
font-variant-east-asian: normal;
font-variant-ligatures: normal;
font-variant-numeric: normal;
font-weight: 400;
height: 1px;
left: 10px;
letter-spacing: normal;
line-height: normal;
margin-bottom: -1px;
margin-left: -1px;
margin-right: -1px;
margin-top: -1px;
outline-color: rgb(0, 0, 0);
outline-style: none;
outline-width: 0px;
overflow-x: hidden;
overflow-y: hidden;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
position: absolute;
text-align: start;
text-indent: 0px;
text-rendering: auto;
text-shadow: none;
text-transform: none;
white-space: nowrap;
width: 1px;
word-spacing: 0px;
writing-mode: horizontal-tb;
-webkit-appearance: checkbox;
-webkit-box-direction: normal;
-webkit-rtl-ordering: logical;
-webkit-border-image: none;

最佳答案

cdk-visually-hidden 类被分配给 Angular Material 复选框内的 HTML 输入元素,并且应该使其不可见。如果您找不到其他方法来阻止元素显示,您可以将以下样式添加到应用程序的全局 CSS 文件中:

.cdk-visually-hidden
{
visibility: hidden;
}

关于javascript - 除了 Angular-Material md-checkboxes 之外,默认的浏览器复选框也出现了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48119601/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com