<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> span{ display: inline-block; width: 10px; height: 10px; border: 1px solid grey; vertical-align: middle; } :checked+span{ background-color: grey; } input[type=radio]{ display: none; } </style> </head> <body> <label><input name="sex" type="radio" /><span></span>男</label> <label><input name="sex" type="radio" /><span></span>女</label> </body> </html> 这样试试
这样试试