Fork me on GitHub

重学前端-HTMl语义标签

重学前端——语义化标签

  • 缩写
    abbr

    1
    <abbr title="World Wide Web">WWW</abbr>
  • 分隔线
    hr - 表示故事走向的转变或话题的转变
    border - 纯粹的视觉效果

  • 注释
    p 标签+class=’note’

  • 加粗

    • strong 表示文本十分重要
    • em 表示强调,可以嵌套,越多层级 表示更大程度的强调
  • 引用

    • blockquote 表示段落级引述内容,
    • q 表示行内的引述内容
    • cite 表示引述的作品名
  • 时间
    time

    1
    <time datetime='2019-01-25'>25 Jan 2019</time>
  • 文章中的图像
    figure 用于表示与主文章相关的图像、照片等流内容
    figcaption 照片图片的描述文字

1
2
3
4
<figure>
<img src='http://www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_PclogoS_8whnvm25&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pcs'>
<figcaption>百度logo</figcaption>
</figure>
  • 定义 ghh
    dfn 标签
1
The <dfn>Internet</dfn> is balalalal
  • 固定格式

    • samp 计算机输出
    • pre 格式不根据浏览变化
    • code 代码段
1
2
3
4
5
6
7
8
9
10
<pre>
<code>>
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</code>
</pre>
-------------本文结束感谢阅读-------------