私は、US Web Design Standardsのスタイルを使用するためのチェックボックス入力の更新に取り組んでいます。しかし、私はrunat = "server"属性を持つ.NETアプリケーション内のページのチェックボックスを更新しようとすると問題に遭遇しました。 runat = "server"属性がない場合、チェックボックスはhttps://standards.usa.gov/components/form-controls/のようにレンダリングされます。 runat = "server"属性では、四角いアウトラインだけがレンダリングされてクリックされますが、背景は青色に変わらず、チェックマークsvgも挿入されません。 スタイルをrunat = "server"で動作させるために何が起こっているのかを理解する助けとなることは、非常に感謝しています。入力CSSスタイルがrunatサーバで動作しない
これは、次のCSS
input.gs-input {
//webkit-appearance: none;
//-moz-appearance: none;
//appearance: none;
border: 0.1rem solid #5b616b;
border-radius: 0;
box-sizing: border-box;
color: #212121;
display: block;
font-size: 1.7rem;
height: 4.4rem;
line-height: 1.3;
margin: 0.2em 0;
max-width: 46rem;
padding: 1rem 0.7em;
width: 100%;
}
label.gs-input {
position: relative;
left: 30px;
}
input.gs-input[type="checkbox"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
input.gs-input[type=checkbox] {
position: absolute;
left: -999em;
}
.lt-ie9 [type=checkbox], .lt-ie9
[type=radio] {
border: 0;
float: left;
margin: 0.4em 0.4em 0 0;
position: static;
width: auto;
}
[type=checkbox] + label.gs-input {
cursor: pointer;
font-weight: 400;
margin-bottom: 0.65em;
}
[type=checkbox] + label.gs-input::before {
background: #ffffff;
border-radius: 2px;
box-shadow: 0 0 0 1px #757575;
content: '\a0';
display: inline-block;
height: 2rem;
line-height: 2rem;
margin-right: 0.6em;
text-indent: 0.15em;
vertical-align: middle;
width: 2rem;
position: absolute;
left: -30px;
}
[type=checkbox]:checked + label.gs-input::before {
background-color: #0071bc;
box-shadow: 0 0 0 1px #0071bc;
}
[type=checkbox]:checked + label.gs-input::before {
background-image: url("../img/correct8.png");
background-image: url("../img/correct8.svg");
background-position: 50%;
background-repeat: no-repeat;
}
[type=checkbox]:disabled + label.gs-input {
color: #d6d7d9;
}
[type=checkbox]:focus + label.gs-input::before {
outline: 2px dotted #aeb0b5;
outline-offset: 3px;
}
[type=checkbox]:disabled + label.gs-input::before {
background: #f1f1f1;
box-shadow: 0 0 0 1px #aeb0b5;
cursor: not-allowed;
}
コントロールまたはweb.configに 'ClientIDMode =" Static "が設定されていますか?それがもう必要かどうかはわかりません。 – wazz
@wazz web.configファイルでClientIDMode = "AutoID"に設定されています。 – jcarapia
Fwiw、標準Webページでは、読み込まれるのは 'correct8.svg'(.pngではない)だけです。そして、私はしばしばディレクトリの前に '..'を削除し、単に'/img'を使います。それはより一貫して動作するように思われる... fwiw。 – wazz