2 Replies Latest reply on Mar 9, 2011 4:34 AM by phreaddee123

    section, article or div?

    gregbowen

      I am learning HTML 5 - going pretty smoothly.

       

      My question is that I have a home page, header, menu and below this 3 content blocks, evenly spaced. They each contain various copy, with header text. For example,

       

      Column 1

       

      About Us

      Lore Ipsum...

       

      Our Advantage

      Lore Ipsum...

       

      Column 2

       

      Our Products

      Lore Ipsum...

       

      Column 3

       

      Contact Form

       

      Twitter Feed

       

      Contact Us

      Lore Ipsum...

       

       

      What is the best markup for this? Normally I would but each column in a div. Would this be best?

       

      <div id="column1">

           <section>

           <h2>About Us</h2>

          <p>Lore Ipsum...</p>

           </section>

           <section>

           <h2>Our Advantage</h2>

           <p>Lore Ipsum...</p>

           </section>
      </div>
      <div id="column2">
           <section>
           <h2>Our Products</h2>
           <p>Lore Ipsum..</p>
           </section>
      </div>
      <div id="column3">
           <form...
           <div id="twitter">
                <script...>
           </div>
           <section>
           <h2>Contact Us</h2>
           <p>Lore Ipsum...</p>
           </section>
      </div>

       

        • 1. Re: section, article or div?
          newToAS3 Level 3

          <div id="column1">

               <section>

           

               <h2>About Us</h2>

              <p>Lore Ipsum...</p>

               </section>

               <section>

           

               <h2>Our Advantage</h2>

               <p>Lore Ipsum...</p>

               </section>
          </div>

           

          I'm also new to HTML5 but in this case I would use 3 sections.

          Note in the quoted example that you're using a div#column1 followed by a section... you probably don't need that. Simply use a section and use some css3 selectors to target the section you need.

           

          In my opinion you don't even need the "column 1, 2 and 3". Just 3 sections will do depending on what you're trying to accomplish.

           

          Anyway, this is just my oppinion and as I said, I'm still learning html5.

          • 2. Re: section, article or div?
            phreaddee123 Level 2

            learning perhaps but you are on the right track

             

            each section can have its own id if they aren't to be exactly the same

             

            and articles "apparently"are great for using with blogs, rss feeds, blah...