I am trying to align these images side by side. Unfortunately, there is a visible gap between the images.
How can I get rid of it without changing the functionality when I click on my radio images, the image appears?
I tried to float the images on the left, but unfortunately this does not work.
HTML:
<div class="buttons">
<input type="radio" name="a" value="1.0" id="b" />
<label for="b"><img id="img1" src="mypicone.png"></label>
<input type="radio" name="a" value="2.0" id="c" />
<label for="c"><img id="img3" src="mypictwo.png"></label>
<input type="radio" name="a" value="3.0" id="d" />
<label for="d"><img id="img5" src="mypicthree.png"></label>
</div>
CSS
input[type="radio"] {
display: none;
}
input[type="radio"]:checked + label {
position: relative
}
input[type="radio"]:checked + label::before {
content: url("//lorempixel.com/10/10");
position: absolute;
left: 15px
}
Violin:
https://jsfiddle.net/emeka/qbukpfn5/1/
Billy source
share