Q: How can I center the list-item elements of two unordered lists as if they were children of just one list?
Example:
{[1][1][1][1][2][2]}
{ [2][2] }
CSS Alignment Challenge
<div>
<ul>
<li>1</li>
<li>1</li>
<li>1</li>
<li>1</li>
</ul>
<ul>
<li>2</li>
<li>2</li>
<li>2</li>
<li>2</li>
</ul>
<div>
Attempts and Solutions
- I tried floating the
<li>
elements left, which almost achieves the desired layout. Adjusting the width of the<div>
container helped, but everything remained left-aligned. - Another attempt involved setting
display: inline
on the<li>
items and applyingtext-align: center
to the parentdiv
. This approach was close but did not fully meet my requirements.