I am working on a layout with two columns of text placed side by side, where one column is right aligned and the other is left aligned.
Below is my current code:
.alignleft {
float: left;
}
.alignright {
float: right;
}
.list-unstyled {
padding-left: 0;
list-style: none;
}
<ul class="store-opening-hours list-unstyled">
<li>
<div style="text-align:left;">
Monday
<span style="float:right;">9:00 AM - 5:00 PM</span>
</div>
</li>
<li></li>
<li>
<div style="text-align:left;">
Tuesday
<span style="float:right;">9:00 AM - 5:00 PM</span>
</div>
</li>
<li></li>
<li>
<div style="text-align:left;">
Wednesday
<span style="float:right;">9:00 AM - 5:00 PM</span>
</div>
</li>
<li></li>
<li>
<div style="text-align:left;">
Thursday
<span style="float:right;">8:30 AM - 11:00 AM</span>
</div>
</li>
<li>
<div style="text-align:right;">
12:30 PM - 2:00 PM
</div>
</li>
<li>
<b>
<div style="text-align:left;">
Friday
<span style="float:right;">9:00 AM - 2:30 PM</span>
</div>
</b>
</li>
<li>
<b>
<div style="text-align:right;">
6:00 PM - 9:00 PM
</div>
</b>
</li>
<li>
<div style="text-align:left;">
Saturday
<span style="float:right;">9:00 AM - 5:00 PM</span>
</div>
</li>
<li></li>
<li>
<div style="text-align:left;">
Sunday
<span style="float:right;">Closed</span>
</div>
</li>
<li></li>
</ul>
Check out the Jsfiddle link here JsFiddle link.
The display appears as two columns side by side, but the right-aligned text is not vertically centered, you can see this in the image provided below:
https://i.stack.imgur.com/4Lrkd.png
Any ideas on how I can achieve proper vertical alignment for the text?