To center align an unordered list, you need to use the CSS text align property. In addition to this, you also need to put the unordered list inside the div element.
Now, add the style to the div class and use the text-align property with center as its value.
See the below example.
<style>
.myDivElement{
text-align:center;
}
.myDivElement ul li{
display:inline;
}
</style>
<div class="myDivElement">
<ul>
<li>Home</li>
<li>About</li>
<li>Gallery</li>
<li>Contact</li>
</ul>
</div>
Here is the reference website Center Align Unordered List