我想在標簽內設定我的 CSS 復選框輸入的樣式這個復選框 不是“記住我”標簽,而是顯示在圖片中的輸入欄位讓它在沒有輸入時顯示白色,當沒有輸入時我想要灰色而不是矩形我想要一個有邊框半徑的矩形,chkbox的大小必須大于org,選擇后我想要不同的風格。
<form>
<div className="form-fields">
<input placeholder="Email or phone number" type="email"></input>
<input placeholder="Password" type="password"></input>
<button className="SignInOrUp">Sign In Or Sign Up</button>
</div>
<div className="check-and-help-field">
<label>
<input type="checkbox"></input>
Remember me
</label>
<a href="/">Need Help?</a>
</div>
<div className="other">
<a href="/" id="facebook-login">
Login with Facebook
</a>
<p>
This page is protected by Google reCAPTCHA to ensure you're not a
bot.
<a href="/" id="learn-more">
Learn more.
</a>
</p>
</div>
</form>
uj5u.com熱心網友回復:
您不能為復選框設定樣式,但可以為其標簽設定樣式。
<input type="checkbox">
<label>
<div class="custom-checkbox"></div> my checkbox
</label>
[type="checkbox"] {
opacity: 0;
position: absolute;
}
[type="checkbox"]:checked ~ .custom-checkbox{
opacity: 1;
width: 10px;
height: 10px;
background-color: grey;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/400089.html
上一篇:螢屏未在kivy中更新
