Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正确使用HTML5语义标记_Html_Semantic Markup - Fatal编程技术网

正确使用HTML5语义标记

正确使用HTML5语义标记,html,semantic-markup,Html,Semantic Markup,我正在努力将语义标签恰当地应用到一个显示古董目录的网站上 第一个问题是关于主体结构: body header h1 h2 nav a ... a main div // Search field and a button to open a spacious filter pane article article article ... article div

我正在努力将语义标签恰当地应用到一个显示古董目录的网站上

第一个问题是关于主体结构:

body
  header
    h1
    h2
    nav
      a
      ...
      a
  main
    div        // Search field and a button to open a spacious filter pane
    article
    article
    article
    ...
    article
    div        // Pagination
  footer
    p
    article
      figure
        img     // depicts the antiquity
      figcaption
        header
          h3    // title of the antiquity
          p     // detailed description of the antiquity
        section
          p     // first owner of the antiquity
          p     // second owner of the antiquity
          ...
          p     // last and therfore current owner of the antiquity
        section
          p     // first literature record on this antiquity
          p     // second literature record on this antiquity
          ...
          p     // last literature record on this antiquity
将带有搜索和筛选选项的两个div以及分页放在主标记中是否正确?或者它们应该在主体标记前后独立

第二个问题是关于上述结构中的条款:

body
  header
    h1
    h2
    nav
      a
      ...
      a
  main
    div        // Search field and a button to open a spacious filter pane
    article
    article
    article
    ...
    article
    div        // Pagination
  footer
    p
    article
      figure
        img     // depicts the antiquity
      figcaption
        header
          h3    // title of the antiquity
          p     // detailed description of the antiquity
        section
          p     // first owner of the antiquity
          p     // second owner of the antiquity
          ...
          p     // last and therfore current owner of the antiquity
        section
          p     // first literature record on this antiquity
          p     // second literature record on this antiquity
          ...
          p     // last literature record on this antiquity

通过查看其他问题和答案,我确信这一部分可以在文章中以这种方式使用是正确的。我完全不确定的是,将完整的古董条目文本放入figcaption。

使用div进行搜索是完全正确的

您可以使用nav元素进行分页:

至于冠词元素的结构。 fig标题应该是fig的第一个子项或最后一个子项,有关更多详细信息,请参见此处:

所以我建议你的文章看起来更像:

article
  figure
    img     // depicts the antiquity
    figcaption  //text about the image
  header
    h1    // title of the antiquity
    p     // detailed description of the antiquity
  section
    p     // first owner of the antiquity
    p     // second owner of the antiquity
    ...
    p     // last and therefore current owner of the antiquity
  section
    p     // first literature record on this antiquity
    p     // second literature record on this antiquity
    ...
    p     // last literature record on this antiquity

虽然最好使用正确的标记,但我不相信您会因为错误而受到惩罚。

使用div进行搜索完全可以

您可以使用nav元素进行分页:

至于冠词元素的结构。 fig标题应该是fig的第一个子项或最后一个子项,有关更多详细信息,请参见此处:

所以我建议你的文章看起来更像:

article
  figure
    img     // depicts the antiquity
    figcaption  //text about the image
  header
    h1    // title of the antiquity
    p     // detailed description of the antiquity
  section
    p     // first owner of the antiquity
    p     // second owner of the antiquity
    ...
    p     // last and therefore current owner of the antiquity
  section
    p     // first literature record on this antiquity
    p     // second literature record on this antiquity
    ...
    p     // last literature record on this antiquity

虽然最好有正确的标记,但我不相信你会因为弄错而受到惩罚。

你的两个问题似乎没有足够的关联性,因此将它们放在同一篇文章中是有意义的。你的两个问题似乎没有足够的关联性,因此将它们放在同一篇文章中是有意义的。