I'm looking to create a structure like this in HTML:
https://i.sstatic.net/wLcZs.png
Does anyone know how I can achieve this layout so that the labels are aligned properly with the radio buttons? My main challenge is getting the horizontal labels above each radio button.
I would appreciate a solution using only HTML and CSS.
Here's my attempt, where I'm using Semantic UI React:
<div class="row question-row">
<div class="three wide column radio-statements"><p>Statement one</p><p>Statement two</p><p>
Statement three</p></div>
<div class="five wide column">
<form class="ui form radio-question"><label class="horizontal-label">High</label><label
class="horizontal-label">Medium</label><label
class="horizontal-label">Low</label><label class="horizontal-label">N/A</label>
<div class="inline fields">
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="1"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="2"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="3"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="4"><label></label></div>
</div>
</div>
<div class="inline fields">
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="5"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="6"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="7"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="8"><label></label></div>
</div>
</div>
<div class="inline fields">
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="9"><label></label></div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="10"><label></label>
</div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="11"><label></label>
</div>
</div>
<div class="field">
<div class="ui fitted radio checkbox"><input type="radio" class="hidden"
readonly="" tabindex="0"
value="12"><label></label>
</div>
</div>
</div>
</form>
</div>
</div>
CSS:
.ui {
.sub-section-grid {
.question-row {
margin-bottom: 30px;
}
.radio-statements {
top: 20px;
}
.horizontal-label {
margin-right: 20px;
font-family: 'Roboto', sans-serif;
font-size: 14px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: 1.57;
letter-spacing: normal;
text-align: left;
color: #868686;
}
.help-text {
font-family: 'Roboto', sans-serif;
font-size: 12px;
font-weight: normal;
font-style: normal;
font-stretch: normal;
line-height: 1.67;
letter-spacing: normal;
text-align: left;
color: rgba(139, 142, 142, 0.7);
}
.info
{
&.circle {
margin-bottom: 20px;
margin-top: -40px;
}
}
}
}