Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> input[type=checkbox] { vertical-align:middle; } input[type=checkbox] + label { color: #999999; font-style: normal; } input[type=checkbox]:checked + label { color: #8ebf42; font-style: italic; font-weight:bold; } </style> </head> <body> <h2>:checked selector example</h2> <form> <input type="checkbox" id="css" name="css"> <label for="css">Here is CSS example.</label> </form> </body> </html>