2013年12月8日 星期日

ul li 置中


CSS:
    <style> 
    ul 
    {
        width:100%;
        background:red;
        height:20px;
        text-align:center;
    }
    li 
    {
        display:inline-block;
        *display:inline; /*IE7*/
        *zoom:1; /*IE7*/
        background:blue;
        color:white;
        margin-right:10px;
    }
    </style>

HTML:
    <ul>
      <li>test</li>
      <li>test</li>
      <li>test</li>
      <li>test</li>
      <li>test</li>
    </ul>
ref: Here

沒有留言:

張貼留言