Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Which code is semantically correct?

    Hi,

    Regarding to HTML5 which of the following codes is right?:

    Code:
    <article>
            <section></section>
    </article>
    OR

    Code:
    <section>
            <article></article>
    </section>
    Thanks

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello kayut,
    I'm still working out the strict usage of the new HTML5 elements so I didn't reply to this post at first.
    No answers for a bit now though so I'll say the second example is correct, but only if the aside contains information that makes sense on it's own, apart from the other information in it's containing <section>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,620
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by kayut View Post
    Hi,

    Regarding to HTML5 which of the following codes is right?:

    Code:
    <article>
            <section></section>
    </article>
    OR

    Code:
    <section>
            <article></article>
    </section>
    Thanks
    Surely that would depend on whether you have one article that is broken up onto sections or have one section of the page that is displaying multiple articles.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,630
    Thanks
    6
    Thanked 1,002 Times in 975 Posts
    Also, a section should typically have a heading. So if you have no use for a heading, it is most likely not a dedicated section either. HTML5Doctor is a good read.

  • #5
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Also, a section should typically have a heading. So if you have no use for a heading, it is most likely not a dedicated section either.
    Read more at http://www.codingforums.com/showthre...7OO9AKb7RDd.99
    Agree! It makes sense?
    However the question is:
    Can an Article contains one or more sections?
    If yes, can anybody give us an example?

  • #6
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Any idea?

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by kayut View Post
    Can an Article contains one or more sections?
    Yes, it would seem so. Explanation and example here.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    kayut (11-11-2012)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •