Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-23 15:02:20 -0700
committerCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-23 15:02:20 -0700
commit1935310fbf26769938a6e9a4008623c7b44fc5a8 (patch)
tree54976a7a6968a25d979ff25eea4cf2e079b88581
parent6ea86c77f56a26bcbb1c90c46e035385791e7ef9 (diff)
IT WORKS! 3-state selector with pure CSS!
-rw-r--r--style.css13
1 files changed, 7 insertions, 6 deletions
diff --git a/style.css b/style.css
index 014ef85..93552b0 100644
--- a/style.css
+++ b/style.css
@@ -161,30 +161,31 @@ input:checked + label + input + label {
border: none;
display: inline;
}
+*/
input {
position: absolute;
opacity: 0;
-} */
+}
label span {
- border-color: red;
+ display: none;
}
label:first-of-type span {
- border-color: black;
+ display: inline-block;
}
label:has(input:checked) span {
- border-color: red;
+ display: none;
}
label:has(+ label input:checked) span {
- border-color: red;
+ display: none;
}
label:has(input:checked) + label span {
- border-color: black;
+ display: inline-block;
}
image#img1 {