My centered list looks great on larger screens, but when the screen size decreases, the extra items shift to the left instead of staying centered. I've tried a couple of different methods to fix this issue, but nothing has worked as desired.
https://i.sstatic.net/w6AZ9.png
First, I attempted the following CSS:
.edit-hours .form .inputs .table ul {
list-style: none;
padding-top: 20px;
max-width: 760px;
margin: auto;
}
https://i.sstatic.net/XinR6.png
Then I experimented with using a flex-box:
.edit-hours .form .inputs .table ul {
list-style: none;
padding-top: 20px;
max-width: 760px;
margin: auto;
display: flex;
justify-content: center;
}
https://i.sstatic.net/9kvNb.png
This is the HTML code I'm working with:
<div class="table">
<ul>
<li class="day">
<input class="day-checkbox" type="checkbox" id="Mon">
<label for="Mon">Monday</label>
</li>
... (remaining list items continued here)
</ul>
</div>
If anyone has a solution to help me achieve the desired centering effect, it would be greatly appreciated!