:checked
In this chapter you will learn:
Description
Radio buttons and check boxes that are checkable can
be selected through the :checked selector.
You can combine :checked
with the negation
selector to select unchecked elements.
Example
<!DOCTYPE HTML> <!-- j a v a 2s. c o m-->
<html>
<head>
<style>
:checked + span {
background-color: red;
color: white;
border: medium solid black;
}
</style>
</head>
<body>
<form method="post" action="http://yourServer/form">
<input type="checkbox" id="myID" name="myName"/>
</form>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » HTML CSS Tutorial » CSS Selector Reference