您好,登錄后才能下訂單哦!
我們直接來看一下具體的實(shí)現(xiàn)代碼:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="./reset.css"> <style> .radio-diy .radiocircle { width: 12px; height: 12px; border: 1px solid #999; border-radius: 50%; cursor: pointer; display: inline-block; } .radio-diy input:checked+span { border: 1px solid#008c8c; } .radio-diy input:checked~span { color: #008c8c; } .radio-diy input:checked+span.radiocircle::after { content: ""; display: block; width: 6px; height: 6px; background: #008c8c; border-radius: 50%; cursor: pointer; margin-left: 3px; margin-top: 3px; } input[type="radio"] { display: none; } </style> </head> <body> 請選擇性別: <label> <input type="radio" name="gender" value="male"> <span></span> <span>男</span> </label> <label> <input type="radio" name="gender" value="female"> <span></span> <span>女</span> </label> </body> </html> radio.css
以上就是使用css樣式制作單選框的詳細(xì)內(nèi)容,更多請關(guān)注億速云其它相關(guān)文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。