HTML 列表

2017/6/16 21:41:27admin0 阅读0 评论

<h2><span style=“color: #00ccff;”><strong>HTML表格标签</strong></span></h2>

<pre class=“line-numbers language-html”><code class=“language-html”><table>…</table> :定义表格
<th>…</th> :定义表格的表头
<tr>…</tr>:定义表格的行
<td>…</td>:定义表格单元
<caption>…</caption> :定义表格标题
<colgroup>…</colgroup> :定义表格列的组
<col>…</col> 定义用于表格列的属性
<thead>…</thead> :定义表格的页眉
<tbody>…</tbody> :定义表格的主体
<tfoot>…</tfoot> :定义表格的页脚 </code></pre>

<h2><span style=“color: #00ccff;”><strong>HTML有序列表和无序列表:</strong></span></h2>
有序列表是一列项目,列表项目使用数字进行标记。 有序列表始于 <ol> 标签。每个列表项始于 <li> 标签。

列表项项使用数字来标记。

<pre class=“line-numbers language-html”><code class=“language-html”><ol>
<li>xiaomo</li>
<li>moshanghua</li>
</ol></code></pre>

同样,无序列表也是一个项目的列表,此列项目使用粗体圆点(典型的小黑圆圈)进行标记。

无序列表始于 <ul> 标签。每个列表项始于 <li>。

<pre class=“line-numbers language-html”><code class=“language-html”><ul>
<li>xiaomo</li>
<li>moshanghua</li>
</ul>
</code></pre>

效果如下:
<a class=“case-show” href=“http://moshanghua.oss-cn-shanghai.aliyuncs.com/demo/html/html-list.html” target=“_blank”>DEMO展示</a>

<h2><span style=“color: #00ccff;”><strong>HTML定义列表:</strong></span></h2>
另外,定义列表是一种特殊的结构,它包括了词条和词条解释两块内容,包含的标签说明如下:
<dl>…</dl>:标识定义列表。
<dt>…</dt>:标识词条。
<dd>…</dd>:标识词条解释。

<pre class=“line-numbers language-html”><code class=“language-html”><dl>
<dt>ol</dt>
<dd>–定义有序列表</dd>
<dt>ul</dt>
<dd>–定义无序列表</dd>
<dt>dl</dt>
<dd>–定义列表</dd>
</dl></code></pre>

效果如下:
<dl>
<dt>ol</dt>
<dd>–定义有序列表</dd>
<dt>ul</dt>
<dd>–定义无序列表</dd>
<dt>dl</dt>
<dd>–定义列表</dd>
</dl>
提示: 以上的列表项内部都可以使用段落、换行符、图片、链接以及其他列表等等的元素来嵌套。
另外,有序和无序列表里面的列表项目可以为其添加属性而变成其他样式。具体如下:
<h2><span style=“color: #00ccff;”><strong>有序列表:</strong></span></h2>
属性:A、a、Ⅰ、ⅰ、start(根据需要而定义有序数字从几开始(数字,字母都可以))

<pre class=“line-numbers language-html”><code class=“language-html”><h4>编号列表:</h4>
<ol>
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ol>

<h4>大写字母列表:</h4>
<ol type="A">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ol>

<h4>小写字母列表:</h4>
<ol type="a">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ol>

<h4>罗马数字列表:</h4>
<ol type="I">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ol>

<h4>小写罗马数字列表:</h4>
<ol type="i">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ol>
<h4>start数字列表:</h4>
<ol start="10">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ol></code></pre>

效果如下:
<a class=“case-show” href=“http://moshanghua.oss-cn-shanghai.aliyuncs.com/demo/html/htmlyouxu.html” target=“_blank”>DEMO展示</a>

<h2><span style=“color: #00ccff;”><strong>无序列表:</strong></span></h2>
属性:disc、circle、square

<pre class=“line-numbers language-html”><code class=“language-html”><h4>默认列表样式:</h4>
<ul>
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ul>

<h4>圆点列表:</h4>
<ul type="disc">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ul>

<h4>圆圈列表:</h4>
<ul type="circle">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ul>

<h4>正方形列表:</h4>
<ul type="square">
<li>小米</li>
<li>魅族</li>
<li>华为</li>
</ul></code></pre>

效果如下:
<a class=“case-show” href=“http://moshanghua.oss-cn-shanghai.aliyuncs.com/demo/html/htmlwuxu.html” target=“_blank”>DEMO展示</a>

<h2><span style=“color: #00ccff;”><strong>嵌套列表:</strong></span></h2>

<pre class=“line-numbers language-html”><code class=“language-html”><h4>嵌套列表1​:</h4>
<ul>
<li>PHP</li>
<li>web前端
<ul>
<li>html5</li>
<li>css3</li>
<li>javascript</li>
</ul>
</li>
<li>Java</li>
</ul>
<h4>嵌套列表2:</h4>
<ul>
<li>PHP</li>
<li>web前端
<ul>
<li>html5</li>
<li>css3</li>
<li>javascript</li>
<0l>
<li>jQuery</li>
<li>AJAX</li>
</ol>
</li>
</ul>
</li>
<li>Java</li>
</ul></code></pre>

<a class=“case-show” href=“http://moshanghua.oss-cn-shanghai.aliyuncs.com/demo/html/nested-list.html” target=“_blank”>DEMO展示</a>