I'm trying to make a poll website for movie night with my friends, but I'm not super hot on html/css. I've used w3schools and some trial and error to get 5 radio buttons set out horizontally, with the text centred above the individual buttons.
The problem is that the middle button isn't centred with the title of the box itself. Another way to see this is that the gap between the left edge and the 1st radio buttons isn't the same size as the gap between the last button and the right edge.
#but {
display: block;
margin-left: auto;
margin-right: auto;
text-align: center
}
#pair {
display: inline-block;
width: 20%;
margin-left: auto;
margin-right: auto;
text-align: center;
}
<fieldset class="pollbox" style="white-space: nowrap;">
<legend align="center">Film Name</legend>
<div id="pair">
<label for="-2">Trash</label>
<input type="radio" name="filmname" value="-2" id="but">
</div>
<div id="pair">
<label for="-1">Dislike</label>
<input type="radio" name="filmname" value="-1" id="but">
</div>
<div id="pair">
<label for="0">Neutral</label>
<input type="radio" name="filmname" value="0" id="but">
</div>
<div id="pair">
<label for="1">Like</label>
<input type="radio" name="filmname" value="1" id="but">
</div>
<div id="pair">
<label for="2">Lush</label>
<input type="radio" name="filmname" value="2" id="but">
</div>
</fieldset>