【问题标题】:HTML5 Symantic advice needed需要 HTML5 语义建议
【发布时间】:2013-05-13 10:37:52
【问题描述】:

我正在写一个Twitter application,它将显示关于 Twitter 用户的以下三 (3) 件事:

  • 获取状态/用户时间线
  • 获取朋友/ID
  • 获取关注者/ID

我的问题是,将上述三 (3) 个内容放在一 (1) 个 <article> 标记中并使用三 (3) 个 <section> 标记分隔它们在语义上是否正确? (参见下面的选项 1)

或者只使用三 (3) 个<article> 标签(上面的每个项目一个)在语义上是否正确? (参见下面的选项 2)

选项 1:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Twitter App</title>  
</head>
<body>
    <article>
        <section>
            <h2>User's Timeline<h2>     
            <!-- Displays GET statuses/user_timeline here -->
        </section>      

        <section>
            <h2>User's Friends<h2>      
            <!-- Displays GET friends/ids here -->
        <section>   

        <section>
            <h2>User's Followers<h2>        
            <!-- Displays GET followers/ids -->
        </section>
    </article>
</body>
</html>

选项 2:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Twitter App</title>  
</head>
<body>
    <article>
        <header>
            <h2>User's Timeline<h2>
        </header>
            <!-- Displays GET statuses/user_timeline here -->
        <footer></footer>
    </article>

    <article>
        <header>
            <h2>User's Friends<h2>
        </header>
            <!-- Displays GET friends/ids here -->
        <footer></footer>
    </article>

    <article>
        <header>
            <h2>User's Followers<h2>
        </header>
            <!-- Displays GET followers/ids -->
        <footer></footer>
    </article>
</body>
</html>

【问题讨论】:

  • 两者都是正确的,完全不会有问题...!!!你遇到什么问题了吗???
  • +1 感谢您的回复。两者都正确吗?好吧,如果两者都正确,我更喜欢使用选项 1,因为它更简洁。我没有任何问题。我只是想确保我正确使用了 html5 标签。谢谢
  • 我希望你会发现这个link 很有用。
  • 我决定使用 1 篇文章(因为一切都是相关的)和 3 个部分。该链接有所帮助。谢谢
  • 不客气... :)

标签: html twitter


【解决方案1】:

两个都对,一点问题都没有……!!!

参考:link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-02
    • 1970-01-01
    • 1970-01-01
    • 2019-01-15
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    相关资源
    最近更新 更多