div中的ul如何居中?

直接贴代码吧。

<style>
    div,ul, li {
        margin: 0px;
        padding: 0px;
    }
    .div {
        border: 1px solid #1594af;
        width: 600px;
        margin: auto;
        *text-align: center;
    }
    .div ul li {
        border: 1px solid #333333;
        background: #CCCCCC;
        color: #000000;
        text-align: center;
        margin-right: 5px;
        list-style: none;
    }
    ul {
        display: table;
        margin-left: auto;
        margin-right: auto;
    }
    ul li {
        float: left;
        *float: none;
        *display: inline;
        *zoom: 1;
    }
</style>
<div class="div">
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
    <br clear="left" />
</div>
}
原文地址:https://www.cnblogs.com/forever-star/p/5144848.html