43. 其他元素
- abbr
表示:缩写词。
示例:
<abbr title="cascading style sheet">CSS</abbr> 是用于为页面添加样式
- time
作用:提供给浏览器或搜索引擎阅读的时间。
示例:
<time datetime="2019-5-1">今年5月</time>袁老录制了HTML 和 CSS的课程
- b(bold)
b元素,以前是一个无语义元素,主要用于加粗字体
示例:
我们学校有两个课程非常受欢迎,<b>HTML&CSS</b> 和 <b>JS</b>
- q
q元素,表示一小段引用文本。
示例:
最近热播的美剧《权力的游戏》中有一句经典台词:<q>在权力的斗争中,非胜即死,没有中间状态</q>
- blockquote
blockquote元素,表示大段引用的文本。
示例:
<blockquote cite="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote">
The HTML <blockquote> 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 <cite> element.
</blockquote>
cite="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote"
表示引用自哪里,里面的内容是给浏览器和搜索引擎看的。
- br
无语义,主要用于在文本中换行。
- hr
无语义,主要用于分割。
- meta
meta元素,还可以用于搜索引擎优化(SEO)。
<meta name="keywords" content="在线商城,美容,微整形">
<meta name="author" content="yuanjin,sdfasdfadf@qq.com">
<meta name="description" content="asdfasdf asfasfasd fasf asd fsd sa f">
这些信息都是给 搜索引擎 看的。
- link
链接外部资源(CSS、图标)
- rel属性:relation,链接的资源和当前网页的关系
- type属性:链接的资源的MIME类型(现在该属性可以省略不写,它会根据rel属性的值来自动识别类型。)
站标的引入方式:
方式1:将图标的名称命名为 favicon.ico
,并将其放在网站的根目录即可。
方式2:图标没有放在根目录,此时命名随意,比如:icon.ico
,需要通过 link 元素来引入。
<!-- 假设 icon.ico 与 index.html 在同一个目录下,可以通过以下方式引入
PS:type 属性,可写可不写;
rel属性值可以是 icon 也可以是 icon 加 shortcut
-->
<link rel="shortcut icon" type="image/x-icon" href="icon.ico">