So I want to figure out if there is a way to get my code to look something like this: What I want it to look like
But my code is looking like this: My Code
I'm farely new to html and css but what I've tried is to put the grid in a 3x2 layout, where my logic is that the label and Checkbox are my rows, so 2 and I've got 3 of them. But I can't manage to get it the way i want. I've also tried flex but I can't manage to get the same result.
.checkbox {
border: 0;
display: grid;
grid-template-columns: max-content max-content;
align-items: center;
padding-left: 0;
}
.boxContainer {
min-width: 40vh;
}
.checkbox label {
display: block;
position: relative;
margin-bottom: .25em;
}
.checkbox label input {
margin-right: .5em;
}
.checkbox .time {
position: absolute;
right: 30%
}
<fieldset class="checkbox">
<div class="title">Ringnes-Ronny</div>
<div class="boxContainer">
<label><input type="checkbox">Polisen<span class="time">59 SEK</span></label>
<label><input type="checkbox">Valhalla<span class="time">39 SEK</span></label>
<label><input type="checkbox">Raggare på stureplan<span class="time">49 SEK</span></label>
<label><input type="checkbox">Monster<span class="time">39 SEK</span></label>
</div>
</div>
<div class="title">Miss Li</div>
<div class="boxContainer">
<label><input type="checkbox">Instruktionsboken<span class="time">39 SEK</span></label>
<label><input type="checkbox">Komplicerad<span class="time">49 SEK</span></label>
<label><input type="checkbox">Starkare<span class="time">(kan ej beställas)</span></label>
</div>
<div class="title">Avicii</div>
<div class="boxContainer">
<label><input type="checkbox">Wake Me Up<span class="time">59 SEK</span></label>
<label><input type="checkbox">Hey Brother<span class="time">49 SEK</span></label>
<label><input type="checkbox">Waiting For Love<span class="time">(kan ej beställas)</span></label>
<label><input type="checkbox">You Make Me<span class="time">29 SEK</span></label>
<label><input type="checkbox">Levels<span class="time">49 SEK</span></label>
</div>
</fieldset>