css列表樣式有哪些?css設定列表樣式的方法

來源:互聯網
上載者:User

關於列表的css樣式有哪些以及如何設定css列表樣式?接下來的這篇文章將為大家介紹關於css列表樣式的內容。

1、css有序列表(ol)和css無序列表(ul)
list.html

<!doctype html><html><head>    <meta charset="utf-8">    <title>列表樣式</title>    <link href="box.css" type="text/css" rel="stylesheet"></head><body>   <p>        <ul>            <li>水果              <ol>                <li>蘋果</li>                <li>香蕉</li>                <li>梨子</li>              </ol>            </li>        </ul>    </p></body></html>

2、css列表標號樣式list-style-type
屬性值:
circle;空心圓
disc; 實心圓
decimal;數字
list.css

 ul>li{     list-style-type:circle;     }ul>li>ol>li{    list-style-type:disc;    }

3、css標號樣式的顯示方式list-style-position
屬性值:outside(在文本之外,預設)
inside(和文本一起)
list.css

ul{    text-align: center;        list-style-position:outside;    }ul>li{    list-style-type:circle;    }ul>li>ol>li{    list-style-type:disc;    }
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.