Works but need to next inputs inside labels if want no text
This commit is contained in:
parent
51f2656ad9
commit
e9d104f078
18
index.html
18
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>
|
||||
|
34
style.css
34
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; */
|
||||
|
Loading…
x
Reference in New Issue
Block a user