how to center 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: center unordered list html
ul {
display: table;
margin: 0 auto;
}
Example 3: how to align list to the centre in css
<div id="menu-centered">
<ul>
<li><a href="">My first item</a></li>
<li><a href="">My second item</a></li>
<li><a href="">My third item</a></li>
<li><a href="">My fourth item</a></li>
<li><a href="">My fifth item</a></li>
</ul>
</div>