大家好,我無法更改輸入的背景顏色。它從瀏覽器類繼承白色 - '用戶代理樣式表',它覆寫了我的類和屬性。問題是我嘗試了 workound 定義論壇上建議的輸入,但沒有幫助。
input {
cursor: inherit;
}
scss:
.authentication-form {
&__input {
@include formBorder;
background-color: darkblue;
padding: 1.5rem;
}
}
HTML:
<form class="authentication-form" method="POST"> {% csrf_token %}
<div class="authentication-form__card">
<h2>Login</h2>
<input class="authentication-form__input" name="username" type="text">
<input class="authentication-form__input" name="password" type="password">
<button class="authentication-form__button" type="submit">Login</button>
</div>
</form>
uj5u.com熱心網友回復:
請參閱此示例以了解樣式輸入。你將不得不input[type=text]在你的 CSS 或 SASS 中撰寫。
input[type=text] {
background-color: darkblue;
color: white;
}
<input type="text" placeholder="text">
為您的應用程式查看此示例:
input {
cursor: inherit;
}
input[type=text] {
background-color: darkblue;
color: white;
padding: 1.5rem;
}
input[type=password] {
background-color: darkblue;
color: white;
padding: 1.5rem;
}
scss:
.authentication-form {
&__input {
@include formBorder;
background-color: darkblue;
padding: 1.5rem;
}
}
<form class="authentication-form" method="POST"> {% csrf_token %}
<div class="authentication-form__card">
<h2>Login</h2>
<input class="authentication-form__input" name="username" type="text" placeholder="username">
<input class="authentication-form__input" name="password" type="password" placeholder="password">
<button class="authentication-form__button" type="submit">Login</button>
</div>
</form>
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/375059.html
