write show:inline-block
as a substitute of float:left
.
li {
show:inline-block;
*show:inline; /*IE7*/
*zoom:1; /*IE7*/
background:blue;
shade:white;
margin-right:10px;
}
We Are Going To Discuss About How do I center list items inside a UL ingredient?. So lets Start this Article.
write show:inline-block
as a substitute of float:left
.li { show:inline-block; *show:inline; /*IE7*/ *zoom:1; /*IE7*/ background:blue; shade:white; margin-right:10px; }
http://jsfiddle.net/3Ezx2/3/
write show:inline-block
as a substitute of float:left
.li { show:inline-block; *show:inline; /*IE7*/ *zoom:1; /*IE7*/ background:blue; shade:white; margin-right:10px; }
http://jsfiddle.net/3Ezx2/3/
write show:inline-block
as a substitute of float:left
.
li {
show:inline-block;
*show:inline; /*IE7*/
*zoom:1; /*IE7*/
background:blue;
shade:white;
margin-right:10px;
}
Original Author sandeep Of This Content
A extra trendy manner is to make use of flexbox:
ul{
list-style-type:none;
show:flex;
justify-content: center;
}
ul li{
show: list-item;
background: black;
padding: 5px 10px;
shade:white;
margin: 0 3px;
}
div{
background: wheat;
}
<div>
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</div>
Original Author hamncheez Of This Content
li{
show:desk;
margin:0px auto 0px auto;
}
This ought to work.
Original Author Kishore Kumar Of This Content
Looks like all you want is text-align: center;
in ul
Original Author Pencilcheck Of This Content
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.