Skip to content

其他元素(了解)

  1. abbr

缩写词

html
<abbr title="cascading style sheet">CSS</abbr> 是用于为页面添加样式的语言
  1. time

提供给浏览器或搜索引擎阅读的时间

html
<time datetime="2019-5-1">今年5月</time> 我录制了HTML 和 CSS的课程
  1. b (bold)

以前是一个无语义元素,主要用于加粗字体

html
<p>我们学校有两个课程非常受欢迎,<b>HTML&CSS</b> 和 <b>JS</b></p>
  1. q

一小段引用文本

html
<p>
  最近热播的美剧《权力的游戏》中有一句经典台词:
  <q cite="https://..."> 在权力的斗争中,非胜即死,没有中间状态 </q>
</p>
  1. blockquote

大段引用的文本

html
<blockquote
  cite="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote"
>
  The HTML &lt;blockquote&gt; Element (or HTML Block Quotation Element)
  indicates that the enclosed text is an extended quotation. Usually, this is
  rendered visually by indentation (see Notes for how to change it). A URL for
  the source of the quotation may be given using the cite attribute, while a
  text representation of the source can be given using the &lt;cite&gt; element.
</blockquote>
  1. br

无语义,主要用于在文本中换行

  1. hr

无语义,主要用于分割

  1. meta

除了设置网页的一些元数据,还可以用于搜索引擎优化(SEO)

html
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  <meta name="keywords" content="在线商城,美容,微整形" />
  <meta name="author" content="ak,sdfasdfadf@qq.com" />
  <meta name="description" content="asdfasdf asfasfasd fasf asd fsd sa f" />
  <!-- ... -->
</head>
  1. link

通常用于链接外部资源(CSS、图标),有两个属性:

  1. rel 属性:relation,链接的资源和当前网页的关系
  2. type 属性:链接的资源的 MIME 类型(省略会自动确定)
html
<head>
  <link rel="stylesheet" type="text/css" href="test3.css" />
  <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>