列表
使用css设置列表样式:
- 用图片做图标:
.part1 {
/*用图片做图标*/
list-style-image: url("2.png");
}
-----------------------------
<ul class="part1">
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
- 删除默认图标:
.part2 {
/*删除默认图标*/
list-style-type: none;
padding: 0;
margin: 0;
}
-----------------------------------
<ul class="part2">
<li>Coffee</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
ul.a {list-style-type:circle;}
----------------------------
<ul class="a">
<li>Circle type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
ul.b {list-style-type:disc;}
-----------------------------
<ul class="b">
<li>Disc type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
ul.c {list-style-type:square;}
--------------------------------
<ul class="c">
<li>Square type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ul>
ol.d {list-style-type:armenian;}
---------------------------------
<ol class="d">
<li>Armenian type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.e {list-style-type:cjk-ideographic;}
---------------------------------------
<ol class="e">
<li>Cjk-ideographic type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.f {list-style-type:decimal;}
--------------------------------
<ol class="f">
<li>Decimal type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.g {list-style-type:decimal-leading-zero;}
---------------------------------------------
<ol class="g">
<li>Decimal-leading-zero type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.h {list-style-type:georgian;}
---------------------------------
<ol class="h">
<li>Georgian type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.i {list-style-type:hebrew;}
---------------------------------
<ol class="i">
<li>Hebrew type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.j {list-style-type:hiragana;}
---------------------------------
<ol class="j">
<li>Hiragana type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.k {list-style-type:hiragana-iroha;}
----------------------------------
<ol class="k">
<li>Hiragana-iroha type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.l {list-style-type:katakana;}
----------------------------------
<ol class="l">
<li>Katakana type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.m {list-style-type:katakana-iroha;}
-------------------------------------
<ol class="m">
<li>Katakana-iroha type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.n {list-style-type:lower-alpha;}
--------------------------------------
<ol class="n">
<li>Lower-alpha type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.o {list-style-type:lower-greek;}
------------------------------------
<ol class="o">
<li>Lower-greek type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.p {list-style-type:lower-latin;}
-------------------------------------
<ol class="p">
<li>Lower-latin type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.q {list-style-type:lower-roman;}
-----------------------------------
<ol class="q">
<li>Lower-roman type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.r {list-style-type:upper-alpha;}
-------------------------------------
<ol class="r">
<li>Upper-alpha type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.s {list-style-type:upper-latin;}
-------------------------------------
<ol class="s">
<li>Upper-latin type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.t {list-style-type:upper-roman;}
-----------------------------------
<ol class="t">
<li>Upper-roman type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.u {list-style-type:none;}
---------------------------------
<ol class="u">
<li>None type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
ol.v {list-style-type:inherit;}
----------------------------------
<ol class="v">
<li>inherit type</li>
<li>Tea</li>
<li>Coca Cola</li>
</ol>
表格
table,th,td{
border: 1px solid blueviolet;
}
table {
/*设置表格的边框是否被折叠成一个单一的边框或隔开*/
/*border-collapse: collapse;*/
width: 100%;
}
th {
height: 50px;
background-color: blue;
color: white;
}
td {
/*text-align水平对齐
verical-align垂直对齐*/
text-align: right;
/*填充*/
padding: 15px;
}
caption {
/*设置标题位置*/
caption-side: bottom;
}
--------------------------------------
<table>
<caption>Table1</caption>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Savings</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
<td>$150</td>
</tr>
<tr>
<td>Joe</td>
<td>Swanson</td>
<td>$300</td>
</tr>
<tr>
<td>Cleveland</td>
<td>Brown</td>
<td>$250</td>
</tr>
</table>