First of all, it is impossible to use only one element, because when you want to implement a customized radio or checkbox, you have to rely on the label of for to achieve it, which is to hide the actual input. Then customize the style of label to implement it, so there are at least two.
First of all, it is impossible to use only one element, because when you want to implement a customized
radio
orcheckbox
, you have to rely on thelabel
offor
to achieve it, which is to hide the actualinput
. Then customize the style oflabel
to implement it, so there are at least two.Achievement
If you simply represent such a graphic, a single
p
can be achieved, that is, through the radial gradient of the backgroundThe above code is the running result, please see
http://jsbin.com/vunoraxoko/e...
Of course, if you want to express
radio
and other radio or check selectionsI am afraid that a single element cannot meet your requirements
For this point, you can refer to @Tomoe’s answer above
Use
border-radius
and css pseudo-class selector:hover
Preview