Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-23 14:25:29 -0700
committerCatalin Mititiuc <Catalin.Mititiuc@gmail.com>2024-03-23 14:25:29 -0700
commite9d104f07823a6165315938ce48cf3d14465fe17 (patch)
tree6257abea7f78f68baa38918d3cdc9621bd51a4f5
parent51f2656ad9b4cfcd1661fec3ea4ef4986cdbee8a (diff)
Works but need to next inputs inside labels if want no text
-rw-r--r--index.html18
-rw-r--r--style.css34
2 files changed, 38 insertions, 14 deletions
diff --git a/index.html b/index.html
index ac6ab02..6dffb03 100644
--- a/index.html
+++ b/index.html
@@ -77,18 +77,12 @@
</p> -->
<p class="damage">
<span>
- <!-- <label>
- </label>
- <label>
- </label>
- <label>
- </label> -->
- <input type="radio" name="d1">
- <!-- <label>label1</label> -->
- <input type="radio" name="d1">
- <!-- <label>label2</label> -->
- <input type="radio" name="d1" checked>
- <!-- <label>label3</label> -->
+ <input type="radio" name="d1" id="clear" checked>
+ <label for="clear">lethal</label>
+ <input type="radio" name="d1" id="bruise">
+ <label for="bruise">clear</label>
+ <input type="radio" name="d1" id="lethal">
+ <label for="lethal">bruise</label>
</span>
</p>
<p><span>Troop Number</span> 1</p>
diff --git a/style.css b/style.css
index 80bd232..ed68970 100644
--- a/style.css
+++ b/style.css
@@ -95,24 +95,54 @@ input {
outline: 2px solid deeppink;
}
+input + label {
+ border: 1px solid red;
+ display: none;
+}
+
input:first-of-type {
outline: none;
}
+label:first-of-type {
+ border: none;
+ display: inline;
+}
+
input:checked {
border: none;
outline: 2px solid deeppink;
}
-input:has(+ input:checked) {
+input:checked + label {
+ border: 1px solid red;
+ display: none;
+}
+
+input:has(+ label + input:checked) {
border: none;
outline: 2px solid deeppink;
}
-input[type="radio"]:checked + input {
+label:has(+ input:checked) {
+ border: 1px solid red;
+ display: none;
+}
+
+input[type="radio"]:checked + label + input {
outline: none;
}
+input:checked + label + input + label {
+ border: none;
+ display: inline;
+}
+
+input {
+ position: absolute;
+ opacity: 0;
+}
+
image#img1 {
transform: scale(3.41) rotate(-0.15deg);
/* opacity: 0.33; */