如果英文好的话,那么看下面这个表格就可以明白标签的含义了。
| 标签 | 英文 |
|---|---|
| h | heading |
| p | paragraph |
| br | break |
| em | emphasis |
| strong | strong |
| ul | unordered list |
| ol | ordered list |
| li | list item |
| dl | definition list |
| dt | definition term |
| dd | definition description |
| pre | Preformatted text |
| table | table |
| tr | table row |
| th | table header cell |
| td | table data cell |
- <h1><h2><h3><h4><h5><h6>
- h是heading的缩写,即标题、题目的意思
这里<hx>是指<h1> <h2> <h3> <h4> <h5> <h6>,数字表示级别,即h1表示一级标题,h2表示2级标题,以此类推。
- <p>
- p是paragraph的缩写,即段落的意思。文章的每个段落都应该使用<p></p>。
- <br/>
- br是break的缩写,即强制换行。
- <em>
- em是emphasis的缩写,即表示强调。有时候为了突出你要表达的某个词或句子,就应该用这个标签
- <strong>
- strong 也是用于强调,比em更进一步强调。
- <ul><li>
- ul是unordered list的缩写,即无序列表,表示每个列表里的项是无序的,或者作者没想过要编号;li是list item的缩写,即列表项
- <ol><li>
- ol是ordered list的缩写,即有序列表,表示列表里的项是有序的,可以对其编号。li是list item的缩写,即列表项
- <dl><dt><dd>
- dl是definition list的缩写,即定义列表。dt是definition term的缩写,即定义条目,dd是definition description的缩写,即定义描述。
用于条目解释是最好的例子。
- <pre>
- pre是 Preformatted text的缩写,即预先格式化的文本。为了表现用户指定的文本表现形式,可以用pre标签。在pre标签内的文本,空格、换行等元素都不会被转义,会原原本本保留下来。
- <table><thead><tfoot><tbody><tr><th><td>
- 这是一组关于表格的标签。一般很少用到<thead>和<tfoot>,因为目前有些浏览器对其支持还不是很好,所以大家基本上都是避而远之。<tr>是指表格的一行,在这一行里,有若干列,就是包含的<th>或是<td>。<th>是table header cell的缩写,意思是表格头部单元格,一般用做说明数据内容;<td>是table data cell的缩写,意思是数据单元格。
- <div>/<span>
- div是division的缩写,span是小范围的意思,两者本意是作为语言与样式的容器(generic language/style container),只是div默认呈现内容的样式是block,而span默认呈现内容的样式是inline。所以div通常被人们用作布局的好东西,而span被作为修改文字样式的标签。
这里只写了常用的标签,有很多没有写出来,想看完整的内容,到w3.org,这里有最详细最权威的解释。