center align list code example
Example 1: centering a list
<div>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</div>
<style>
div {
text-align: center;
}
ul {
display: inline-block;
text-align: left;
}
</style>
Example 2: how to center a list in html
/* Either center the list directly or center the parent element */
ul {
text-align: center;
}
/* OR */
div .list {
text-align: center;
}