Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save techxdeveloper/86211531a4550aa50005fa825ba602f9 to your computer and use it in GitHub Desktop.
Save techxdeveloper/86211531a4550aa50005fa825ba602f9 to your computer and use it in GitHub Desktop.
CSS Psuedo Class Selector (:checked)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Psuedo Class Selector (:checked)</title>
<style>
h1 {
color: #00bdc4;
border-bottom: 1px solid #bdbdbd;
padding-bottom: 20px;
}
input {
margin: 30px;
}
input + label {
background-color: #9e9e9e;
border-radius: 2px;
padding: 20px;
color: #f5f5f5;
}
input:checked + label {
background-color: #00bcd4;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<div>
<h1>CSS Psuedo Class Selector (:checked)</h1>
<form action="">
<input type="checkbox" name="html">
<label for="html">HTML</label><br>
<input type="checkbox" name="css">
<label for="css">CSS</label><br>
<input type="checkbox" name="js">
<label for="js">JavaScript</label><br>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment