center ul element css 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 ul
dropdwon-menu {
left: 50%;
transform: translateX(-50%);
}
Example 3: center li in ul css
.list-wrapper {
text-align: -webkit-center;
}
.list-wrapper ul {
display:block;
}