[英]radiobutton styling without label
是否可以僅使用 css 樣式,一個沒有標簽的單選按鈕? 帶有標簽的單選按鈕看起來確實不錯,但沒有標簽的單選按鈕根本不出現。 沒有通過互聯網為我的問題找到任何合適的解決方案。
http://codepen.io/anon/pen/iJjru/
input.form-radio:empty{
margin-left: -9999px}
input.form-radio:empty ~ .description {
position: relative;
float: left
text-indent: 30px
margin-top: 0 }
input.form-radio:empty ~ .description:before {
position: absolute
display: block
top: 3px
bottom: 0
left: 0
content: ''
width: 10px
height: 10px
background: #fff
border-radius: 30px
border: 2px solid #fdd68d }
input.form-radio:hover:not(:checked) ~ .description.option:before {
text-indent: .9em
color: #C2C2C2
background-color: orange }
input.form-radio:hover:not(:checked) ~ .description {
color: #888 }
input.form-radio:checked ~ .description:before {
text-indent: .9em
background-color: orange }
input.form-radio:checked ~ .description {
color: #777}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.