表达无序列表语义的html标签是,HTML语义标签的介绍和常用的语义标签

语义化标签目的

主要目的就是让大家直观的认识标签(markup)和属性(attribute)的用途和作用,很明显Hx系列看起来很像标题,因为拥有粗体和较大的字号。,用来区别于其他文字,起到了强调的作用。

与默认样式的区别

默认样式是浏览器设定的一些常用tag的表现形式

语义化是一种纯文字的补充,让大家直观的认识标签和属性的用途和作用

语义化标签的使用意义

代码结构: 使页面没有css的情况下,也能够呈现出很好的内容结构,有利于页面布局,特别是在移动应用上(弹性盒子方面)

2.有利于SEO: 爬虫依赖标签来确定关键字的权重,因此可以和搜索引擎建立良好的沟通,帮助爬虫抓取更多的有效信息

3.提升用户体验: 例如title、alt可以用于解释名称或者解释图片信息,以及label标签的灵活运用。

4.便于团队开发和维护: 语义化使得代码更具有可读性,让其他开发人员更加理解你的html结构,减少差异化。

5.方便其他设备解析: 如屏幕阅读器、盲人阅读器、移动设备等,以有意义的方式来渲染网页。

使用的场景

作为自然语言和纯文字的补充,用来表达一定的结构表达

必要的存在,一旦没有时文字会产生歧义

适合机器阅读的整体结构

b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

2019-07-09_144941.jpg

HTML5提供了新的语义元素来定义网页的不同部分,它们被称为“切片元素”,如图所示

b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

20180626164405788.jpg

HTML

元素 定义文档的标题,显示在浏览器的标题栏或标签页上。它只可以包含文本,若是包含有标签,则包含的任何标签都不会被解释。常用的语义化标签

:

h1~h6,分级标题,

与 协调有利于搜索引擎优化。

一级标题

二级标题

三级标题

四级标题
五级标题
六级标题

b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

2019-07-08_215005.jpg

HTML

  • 元素(或称 HTML 无序列表元素)表示一个内可含多个元素的无序列表或项目符号列表。(一般搭配
  • 来用)
    • .....
    • ....
    • ...
    1. :

    HTML

    1. 元素 表示多个有序列表项,通常渲染为有带编号的列表(一般搭配
    2. 来用)。
      1. *****
      2. ****
      3. ***

      因为是无序和有序列表所以我展示的是效果比对图:

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-08_220126.jpg

      HTML 元素用于展示介绍性内容,通常包含一组介绍性的或是辅助导航的实用元素。它可能包含一些标题元素,但也可能包含其他元素,比如 Logo、搜索框、作者名称,等等。

      Cute Puppies Express!

      I love beagles so much! Like, really, a

      lot. They’re adorable and their ears are so, so snuggly soft!

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_144142.jpg

      HTML导航栏 () 描绘一个含有多个超链接的区域,这个区域包含转到其他页面,或者页面内部其他部分的链接列表.

      1. Bikes
      2. BMX
      3. Jump Bike 3000

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_144417.jpg

      HTML 元素呈现了文档的 或应用的主体部分。主体部分由与文档直接相关,或者扩展于文档的中心主题、应用的主要功能部分的内容组成。

      Gecko facts

      Geckos are a group of usually small, usually nocturnal lizards.

      They are found on every continent except Australia.

      Many species of gecko have adhesive toe pads which enable them to

      climb walls and even windows.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_144751.jpg

      表示文档、页面、应用或网站中的独立结构,其意在成为可独立分配的或可复用的结构,如在发布中,它可能是论坛帖子、杂志或新闻文章、博客、用户提交的评论、交互式组件,或者其他独立的内容项目。

      Weather forecast for Seattle

      03 March 2018

      Rain.

      04 March 2018

      Periods of rain.

      05 March 2018

      Heavy rain.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_145753.jpg

      HTML Section 元素 () 表示文档中的一个区域(或节),比如,内容中的一个专题组,一般来说会有包含一个标题(heading)。一般通过是否包含一个标题 (

      -

      element) 作为子节点 来 辨识每一个,或者是定义文档中的节(section、区段)。比如章节、页眉、页脚或文档中的其他部分。

      Introduction

      People have been catching fish for food since before recorded history…

      Equipment

      The first thing you’ll need is a fishing rod or pole that you find comfortable and is strong enough for the kind of fish you’re expecting to land…

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_150022.jpg

      元素表示一个和其余页面内容几乎无关的部分,被认为是独立于该内容的一部分并且可以被单独的拆分出来而不会使整体受影响。如侧栏、文章的一组链接、广告、友情链接、相关产品列表等。

      Salamanders are a group of amphibians with a lizard-like appearance, including short legs and a tail in both larval and adult forms.

      The Rough-skinned Newt defends itself with a deadly neurotoxin.

      Several species of salamander inhabit the temperate rainforest of the Pacific Northwest, including the Ensatina, the Northwestern Salamander and the Rough-skinned Newt. Most salamanders are nocturnal, and hunt for insects, worms and other small creatures.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_150517.jpg

      表示最近一个章节内容或者根节点(sectioning root )元素的页脚。一个页脚通常包含该章节作者、版权数据或者与文档相关的链接等信息。只有当父级是body时,才是整个页面的页脚。

      © 2018 Gandalf

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_152631.jpg

      將使文本的字体变小一号。(例如从大变成中等,从中等变成小,从小变成超小)。在HTML5中,除了它的样式含义,这个元素被重新定义为表示边注释和附属细则,包括版权和法律文本。即呈现小号字体效果,指定细则,输入免责声明、注解、署名、版权。

      MDN Web Docs is a learning platform for Web technologies and the software that powers the Web.


      The content is licensed under a Creative Commons Attribution-ShareAlike 2.5 Generic License.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_152833.jpg

      Strong 元素 ()表示文本十分重要,一般用粗体显示和 em 标签一样,用于强调文本,但它强调的程度更强一些。

      The content is good

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_153224.jpg

      HTML 着重元素 () 标记出需要用户着重阅读的内容, 元素是可以嵌套的,嵌套层次越深,则其包含的内容被认定为越需要着重阅读。将其中的文本表示为强调的内容,表现为斜体。

      In HTML 5, what was previously called block-level content is

      now called flow content.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_153513.jpg

      HTML mark 标签代表突出显示的文字,例如可以为了标记特定上下文中的文本而使用这个标签. 举个例子,它可以用来显示搜索引擎搜索后关键词。使用高亮突出显示部分文本。

      <mark> 元素用于 高亮 文本

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_153710.jpg

      元素代表一段独立的内容, 经常与说明(caption)
      配合使用, 并且作为一个独立的引用单元。当它属于主内容流(main flow)时,它的位置独立于主体。这个标签经常是在主文中引用的图片,插图,表格,代码段等等,当这部分转移到附录中或者其他页面时不会影响到主体。(默认有40px左右margin)。

      例如以下的诗歌:

      Bid me discourse, I will enchant thine ear,

      Or like a fairy trip upon the green,

      Or, like a nymph, with long dishevell'd hair,

      Dance on the sands, and yet no footing seen:

      Love is a spirit all compact of fire,

      Not gross to sink, but light, and will aspire.

      Venus and Adonis,

      by William Shakespeare

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_154700.jpg

      HTML

      元素 是与其相关联的图片的说明/标题,用于描述其父节点
      元素里的其他数据。这意味着
      块里是第一个或最后一个。同时 HTML Figcaption 元素是可选的;如果没有该元素,这个父节点的图片只是会没有说明/标题。

      Get browser details using

      navigator.

      function NavigatorExample() {

      var txt;

      txt = "Browser CodeName: " + navigator.appCodeName;

      txt+= "Browser Name: " + navigator.appName;

      txt+= "Browser Version: " + navigator.appVersion ;

      txt+= "Cookies Enabled: " + navigator.cookieEnabled;

      txt+= "Platform: " + navigator.platform;

      txt+= "User-agent header: " + navigator.userAgent;

      }

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_154951.jpg

      HTML引用( Citation)标签 () 表示一个作品的引用。它必须包含引用作品的符合简写格式的标题或者URL,它可能是一个根据添加引用元数据的约定的简写形式。

      It was a blog about computer technology.

      the

      href="https://qaqsarah.github.io/">blog

      by qian.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_160519.jpg

      HTML

      元素(或者 HTML 块级引用元素),代表其中的文字是引用内容。通常在渲染时,这部分的内容会有一定的缩进(注 中说明了如何更改)。若引文来源于网络,则可以将原内容的出处 URL 地址设置到 cite 特性上,若要以文本的形式告知读者引文的出处时,可以通过 元素。

      Words can be like X-rays, if you use them properly—they’ll go

      through anything. You read and you’re pierced.

      —Aldous Huxley, Brave New World

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_161130.jpg

      HTML引用标签 ()表示一个封闭的并且是短的行内引用的文本. 这个标签是用来引用短的文本,所以请不要引入换行符; 对于长的文本的引用请使用

      替代.(跨浏览器问题,尽量避免使用)。

      Everytime Kenny is killed, Stan will announce

      Oh my God, you/they killed Kenny!

      .

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_161338.jpg

      用来表示24小时制时间或者公历日期,若表示日期则也可包含时间和时区。datetime属性遵循特定格式,如果忽略此属性,文本内容必须是合法的日期或者时间格式。

      The concert took place on July

      09.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_161753.jpg

      缩写元素()用于展示缩写,并且可以通过可选的 title 属性提供完整的描述。

      You can use CSS to style your HTML.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_162529.jpg

      HTML 定义元素 () 表示术语的一个定义(定义术语元素),与定义必须紧挨着,可以在描述列表dl元素中使用。

      术语定义应当在

      , 或定义列表 (通常是, 对)中给出。被定义术语的值由下列规则确定:

      如果 元素有一个 title 属性,那么该术语的值就是该属性的值。否则,如果它仅包含一个 元素,该元素拥有 title 属性,那么该术语的值就是该属性的值。否则, 元素的文本内容就是该术语的值。

      WWW

      The World-Wide Web (WWW) is a system of interlinked hypertext documents accessed on the Internet.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_182203.jpg

      表示其中的 HTML 提供了某个人或某个组织(等等)的联系信息。

      Contact the author of this page:

      jim@rock.com

      (311) 555-2368

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_182728.jpg

      表示一些被从文档中删除的文字内容。比如可以在需要显示修改记录或者源代码差异的情况使用这个标签。标签的作用恰恰于此相反:表示文档中添加的内容。

      This text has been deleted, here is the rest of the paragraph.

      This paragraph has been deleted.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_182957.jpg

      HTML 元素定义已经被插入文档中的文本。

      “You're late!”

      “I apologize for the delay.”

      “A wizard is never late …”

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_183145.jpg

      元素呈现一段计算机代码. 默认情况下, 它以浏览器的默认等宽字体显示.

      Regular text. This is code. Regular text.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_183318.jpg

      HTML 元素用来显示已知范围的标量值或者分数值。。(Internet Explorer 不支持 meter 标签)

      Heat the oven to

      value="350">350 degrees

      .

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_183503.jpg

      HTML中的progress () 元素用来显示一项任务的完成进度.虽然规范中没有规定该元素具体如何显示,浏览器开发商可以自己决定,但通常情况下,该元素都显示为一个进度条形式.

      70 %

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_183652.jpg

      :

      表示预定义格式文本。在该元素中的文本通常按照原文件中的编排,以等宽字体的形式展现出来,文本中的空白符(比如空格和换行符)都会显示出来。(紧跟在

       开始标签后的换行符也会被省略)

      Using CSS to change the font color is easy.

       
             

      body {

      color: red;

      }

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_183848.jpg

      :

      元素用于标识计算机程序输出,通常使用浏览器缺省的 monotype 字体(例如 Lucida Console)。

      Regular text. This is sample text. Regular text.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_184045.jpg


      :

      表示段落级元素之间的主题转换(例如,一个故事中的场景的改变,或一个章节的主题的改变)。在HTML的早期版本中,它是一个水平线。现在它仍能在可视化浏览器中表现为水平线,但目前被定义为语义上的,而不是表现层面上。

      This is the first paragraph of text.

      This is the first paragraph of text.

      This is the first paragraph of text.

      This is the first paragraph of text.


      This is the second paragraph of text.

      This is the second paragraph of text.

      This is the second paragraph of text.

      This is the second paragraph of text.

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_184240.jpg

      :

      HTML

      元素(或者说 HTML 段落元素)表示文本的一个段落。该元素通常表现为一整块与相邻文本分离的文本,或以垂直的空白隔离或以首行缩进。另外,

      是块级元素。只要涉及文字段落几乎都用到,这是最常见的一个语义标签.

      这是第一个段落。这是第一个段落。

      这是第一个段落。这是第一个段落。

      这是第二个段落。这是第二个段落。

      这是第二个段落。这是第二个段落。

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_184534.jpg

      :

      HTML Element (HTML Headings Group Element) 代表一个段的标题。它规定了在文档轮廓里(the outline of the document )的单一标题是它所属的隐式或显式部分的标题。

      Main title

      Secondary title

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      2019-07-09_184946.jpg

      接下来再补充以下Witter大神给的补充标签:

      b395ea066de3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

      9684130e423b6734b23652f4f0b6359e.jpg

      平时使用HTML标签时应该注意以下几点:

      尽可能少的使用无语义的标签div和span;

      在语义不明显时,既可以使用div或者p时,尽量用p, 因为p在默认情况下有上下间距,对兼容特殊终端有利;

      不要使用纯样式标签,如:b、font、u等,改用css设置。

      需要强调的文本,可以包含在strong或者em标签中(浏览器预设样式,能用CSS指定就不用他们),strong默认样式是加粗(不要用b),em是斜体(不用i);

      使用表格时,标题要用caption,表头用thead,主体部分用tbody包围,尾部用tfoot包围。表头和一般单元格要区分开,表头用th,单元格用td;

      表单域要用fieldset标签包起来,并用legend标签说明表单的用途;

      每个input标签对应的说明文本都需要使用label标签,并且通过为input设置id属性,在lable标签中设置for=someld来让说明文本和相对应的input关联起来。

      特别注明:以上的内容是本人在学习了winter大神的《重学前端》的语义化标签和一些相关博文后结合自身实际开发使用的情况下,总结得到这篇文章,若有哪里不对或者不好之处,可评论留言告知,小女子在此谢过!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值