HTML
<fieldset>
<label id="radio-buttons">Would you recommand this website?
<input type="radio" name="radio" value="button" class="inline" checked>Yes</input>
<input type="radio" name="radio" value="button" class="inline">No</input>
<input type="radio" name="radio" value="button" class="inline">Maybe</input>
</label>
</fieldset>
CSS
input{
margin: 5px 0 0 0;
width: 100%;
min-height: 1.3em;
}
.inline{
width: unset;
margin: 0 0.5em 0 0;
vertical-align: middle;
}
I tried aligning the radio buttons with the text itself but the buttons end up being a few pixels above the text, I tried everything I could find online and nothing works.
2
Answers
In that case you need to rework the whole thing. Here’s a quick fix. And here’s more info on how to set it up properly in the future: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset
<Label>
and<input>
doesn’t work this way.This way clicking on
Yes
,No
orMaybe
will effect on their respectives radio boxes.