In the past, I saw various examples of CSS3 beautification check boxes on the Internet, which are sorted out today for easy viewing later.
This example involves the binding of input and lable, and the use of opacity (opacity)
First on the effect:
Source:
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>CSS3 Landscaping check box</title> <styletype= "Text/css">form{Border:1px solid #ccc;padding:20px;width:300px;margin:30px Auto;}. Wrapper{Margin-bottom:10px;}. Box{Display:Inline-block;width:20px;Height:20px;Margin-right:10px;position:relative;Border:2px Solid Green;vertical-align:Middle;}. Box Input{Opacity:0;position:Absolute;Top:0; Left:0;}. Box span{position:Absolute;Top:-10px; Right:3px;font-size:30px;Font-weight:Bold;font-family:Arial;-webkit-transform:Rotate (30deg);Transform:Rotate (30deg);Color:Green;}input[type= "checkbox" + span{Opacity:0;}input[type= "checkbox"]:checked + span{Opacity:1;} </style></Head><Body> <formAction="#"> <Divclass= "wrapper"> <Divclass= "box"> <inputtype= "checkbox"checked= "Checked"ID= "Usename" /><span>√</span> </Div> <lable for= "Usename">I'm the selected state.</lable> </Div> <Divclass= "wrapper"> <Divclass= "box"> <inputtype= "checkbox"ID= "Usepwd" /><span>√</span> </Div> <label for= "Usepwd">I'm not selected</label> </Div></form></Body></HTML>
"CSS Notes" CSS3 beautify check box