Images involved in this article
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <style type = "text/ css "> body {margin: 0px; padding: 0px; font-size: 13px ;}. input_style {padding: 6px 0px; width: 600px; margin: 0px auto; border-bottom: #666666 1px dotted ;}. input_style span {display: inline-block; width: 15px; height: 15px; text-align: left; vertical-align: middle; _ overflow: hidden ;}. input_style label {padding: 0px 6px; cursor: pointer ;}. input_style input {cursor: pointer ;}. checkbox {padding: 0px; list-style: none; width: 600px; margin: 6px auto; height: auto; overflow: hidden ;}. checkbox li {padding: 3px 0px; float: left;} h4 {width: 600px; margin: 0px auto; margin-top: 30px ;}. button {width: 600px; text-align: center; margin: 0px auto ;} </style> <title> use javascript to customize radio and checkbox styles </title> </pead> <body> single border style: <input type = "radio" name = "sex" value = "boy" checked = "checked" id = "sex_boy"/> <label for = "sex_boy"> male </ label> <input type = "radio" name = "sex" value = "girl" id = "sex_girl"/> <label for = "sex_girl"> female </label> <input type = "radio" name = "marry" value = "yes" id = "marry_yes"/> <label for = "marry_yes"> boy </label> <input type = "radio" name = "marry" value = "not" checked = "checked" id = "marry_not"/> <label for = "marry_not"> girl </label> check box style: <ul class = "checkbox input_style"> <li> <input type = "checkbox" name = "Hober" checked = "checked" id = "hobby1"/> <label for = "hobby1"> xhtml </label> </li> <input type = "checkbox" name = "holobby" id = "hobby2"/> <label for =" hobby2 "> CSS </label> </li> <input type =" checkbox "name =" holobby "id =" hobby3 "/> <label for =" hobby3 "> Javascript </label> </li> <input type =" checkbox "name =" holobby "id =" hobby4 "/> <label for =" hobby4"> Flash </label> </li> <input type = "checkbox" name = "holobby" id = "hobby5"/> <label for = "hobby5"> ajax </label> </li> <input type = "checkbox" name = "holobby" id = "hobby6"/> <label for = "hobby6"> </label> </li> <input type = "checkbox" name = "holobby" id = "hobby7"/> <label for = "hobby7"> Flex </label> </li> <input type = "checkbox" name = "Hober" id = "hobby8"/> <label for = "hobby8"> PHP /. NET/JSP </label> </li> </ul> <ul class = "checkbox input_style"> <li> <input type = "checkbox" name = "holobby" checked = "checked" id = "hobby9"/> <label for = "hobby9"> learn more </label> </li> <input type = "checkbox" name = "holobby" id = "hobby10"/> <label for = "hobby10"> General </label> </li> <input type = "checkbox" name =" holobby "id =" hobby11 "/> <label for =" hobby11 "> skilled </label> </li> <input type =" checkbox "name =" holobby "id =" hobby12 "/> <label for =" hobby12 "> proficient </label> </li> <input type =" checkbox "name =" holobby" id = "hobby13"/> <label for = "hobby13"> Senior Expert </label> </li> </ul> <input type = "button" value = "Load style "/> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]