【问题标题】:HTML5 semantic transformationHTML5 语义转换
【发布时间】:2014-09-23 17:33:08
【问题描述】:

这个更正在语义上是正确的吗?我在 HTML cmets 中写下了我的疑问以解释我的想法。

<article>
    <h2>Movies</h2>
    <h4>Genres</h4>
    <p>Below you can see the <b>available genres</b>:</p>
    <p>1. Action</p>
    <p>2. War</p>
    <p>3. Comedy</p>
    <p>4. Horror</p>
</article>

VS

<section> <!-- Section instead of article? -->
    <header>
         <h2>Movies</h2> 
         <h4>Genres</h4><!-- Should i use to h tags inside the same header? http://www.w3.org/TR/html5/sections.html#headings-and-sections. There sais: "h1–h6 elements must not be used to markup subheadings, subtitles, alternative titles and taglines unless intended to be the heading for a new section or subsection. Instead use the markup patterns in the Common idioms without dedicated elements section of the specification."-->
         <p>Below you can see the <b>available genres</b>:</p> <!-- <b> or <strong>?-->
    </header>
    <ol><!-- ol or ul and place the numbers? -->
        <li>Action</li>
        <li>War</li>
        <li>Comedy</li>
        <li>Horror</li>
    </ol>
</section>

【问题讨论】:

  • 是的,看起来很合适。
  • 在HTML5中,你可以在任何你想写的地方写cmets。
  • 你应该关闭那个&lt;section&gt; BTW...
  • 请注意,这个问题与 cmets 无关!

标签: html semantics


【解决方案1】:

部分和标题都很好。流派的功能/相互作用是什么?如果它们将是菜单选项,我将包含在 中,否则我将使用 UL,因为它们不在需要维护的特定顺序中。

【讨论】:

    【解决方案2】:

    &lt;b&gt; - “代表一段文本,在风格上与普通散文有所偏移,但不传达任何额外的重要性”。

    &lt;strong&gt; - “代表其内容的重要性。” source

    其他标签取决于它们的上下文。

    【讨论】:

      【解决方案3】:

      文章是错误的 - 例如,放在 RSS 提要中是没有意义的。 section 可以,div 可能会更好。

      粗体只是为了格式化,不是为了强调,所以b 可以。

      如果你坚持使用部分,header 它应该有 H1 和 H2,而不是 H3 和 4。

      如果顺序很重要,ol,如果不是ul

      【讨论】:

      【解决方案4】:

      在 HTML5 中,您可以随心所欲地编写 cmets。

          <section>
              <p> <!--new P tag -->
                  <span>new <!--this new paragraph-->paragraph</span>
              </p>
          </section>

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-08-29
        • 2013-03-27
        • 2020-12-12
        • 2014-04-03
        • 1970-01-01
        • 2015-06-20
        • 2015-02-21
        • 1970-01-01
        相关资源
        最近更新 更多