Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: How to properly use HTML5 section tag

  1. #1
    Join Date
    May 2012

    How to properly use HTML5 section tag

    I was informed that I am using HTML5's section tag incorrectly. Can anyone show me the proper way to use HTML5's section tag?

        <div id="content-container">
         <div id="form">
    	  <label class="block">
    	     <input type="text" id="zip" class="normal" type="zip" autocomplete="on" value="zip code">
    	  <button type="submit"  id="submit" value="CHECK NOW" title="check now">check now</button>
        </div><!-- end form -->
      	<img width="959" height="330" alt="clear form" src="img/widthHero.png"/>
       <div id="content">
       <section id="noInstall">
      	<a href="#"><img src="img/noInstall.png" alt="No Installation Appointments" title="No Installation Appointments" /></a>
      <section id="affordable">
      	<a href="#"><img src="img/affordablePlan.png" alt="Affordable Plans" title="Affordable Plans" /></a>
      <section id="tomorrow">
      	<a href="#"><img src="img/onlineTomorrow.png" alt="Get Online By Tomorrow" title="Get Online By Tomorrow" /></a>
      <section id="take-w-you">
      	<a href="#"><img src="img/takeInternet.png" alt="Take It With You Internet" title="Take It With You Internet" /></a>
      <section id="coverage">
      	<a href="#"><img src="img/cwCoverage.png" alt="City Wide Coverage" title="CityWide Coverage" /></a>
     </div><!-- end content-->

  2. #2
    Join Date
    Aug 2012
    From what I have been reading recently, don't use section, article or aside, they are pointless and you are better just sticking to divs.

  3. #3
    Join Date
    May 2005
    Gold Coast (MS)
    When to Use the HTML5 “section” Element

    When to Use the HTML5 SECTION Element

    The section element

    Those might help. The section tag is not to be used the same as a div tag. The SECTION Element is a Semantic Element.

  4. #4
    Join Date
    Aug 2012
    And it doesn't even have any point as a SEMANTIC ELEMENT at the moment!!! Better off using Aria Roles

  5. #5
    Join Date
    May 2012
    I appreciate your feedback. It's really frustrating because some articles i've read say "take advantage of the new HTML5 tags" while others say HTML5 elements such as the section tag "don't have a specific use/ purpose so it should be avoided". W3C.org is very vague (imo). I was viewing one article that stated section tags are to be used as a replacement for div tags, however after viewing this article http://html5doctor.com/avoiding-common-html5-mistakes/ it states use section tags as a wrapper is bad coding practice... What is the purpose of introducing section tag if there is no purpose for it? The role attribute was introduced in XHTML but was later omitted however with HTML5 it has been re-introduced. How should the role attribute be properly used?

  6. #6
    Join Date
    Aug 2012
    I wish I could help you further but I am really in the same position as you - I initially read all about the HTML5 tags and started using them, only to now read (at the same sources as you have been reading really) that they don't really do anything and also shouldn't be used for styling, so in affect, completely pointless.

    What really clarified this for me is that I have started reading a book - The Truth About HTML5 (For Web Designers) by Luke Stevens and it makes sense how he explains it all (I haven't finished the book yet but so far so good).

    The point of the AIRA Roles is for screen readers / visually impaired, which makes a lot more sense to me.

  7. #7
    Join Date
    May 2012
    Thank You!!!! I have been looking for a good book on HTML5. I will be creating a new post for this question but wanted your feedback, what tools are you currentlyusing for cross-browser compatibility testing? I was using ie tester but that proved to be unreliable, since I have started using IE's developer tool which is somewhat similar to Chrome's developer tool (but not as good imo).

  8. #8
    Join Date
    Aug 2012
    I usually use Browserlab by Adobe for cross-browser testing but that is not always accurate either and then sometimes free online testers (can't remember site names off the top of my head, sorry).

  9. #9
    Join Date
    Sep 2008
    No point in having a section just to house a link. It would make more sense to have a <section> that housed all your links. Also, each section can have a <header> and <footer>. HTML5 <header>s and <footer>s aren't how developers would normally view a header and footer. But as other posters have said, there is no SEO advantage to using new HTML5 tags. You're better off with <div>s that have classes and ids.

  10. #10
    Join Date
    Oct 2012
    Bengough, SK, Canada

    Lightbulb How I use the section tags!

    In your code example it looked like something i had setup a few days ago. I don't use <div> anymore in my projects and have moved up to getting standard with HTML5. After your form ends you could just use a list to pump out those links and just slap the list into a <section>. You just had the section too far down the hierarchy. You could do it like this.

    <section id="pwrap">
    <section id="formCheck"> <form> Zip Code: <input type="text" name="fname"><br> <input type="submit" value="Check Now"> </form> </section> <section id="content"> <ul> <li id="noInstall"><a href="#">(image)</a></li> <li id="yesInstall"><a href="#">(image)</a></li> </ul> </section>
    When you use HTML5 tags it for the most part makes your markup easy to understand and makes more sense. I'm assuming you id'd your sections for another reason? If you need any further help with HTML5 tags just get a hold of me, I am a big supporter.

  11. #11
    Join Date
    Sep 2008
    That's a perfectly illustrated misuse of <section>. HTML5 is in its infant stages. It's not a final product yet. Windows XP will be around for several more years, and the most they can ever upgrade to is IE8. There is no IE9 for XP, and there never will be. Using HTML5 in older legacy IE browsers will cause the site to break. You get no SEO benefits to using HTML5. It's redundant. Just learn HTML and use classes and advanced CSS selectors.

  12. #12
    Join Date
    Oct 2012
    Bengough, SK, Canada
    It works, it's clean and it's up to date. If you want to design backwards for those who stand still then that is certainly one approach. Just be careful you don't get left behind :P

  13. #13
    Join Date
    Sep 2008
    It works. It's not clean, and it's not semantically correct. By your standards, let's eliminate 50% of computer users in the world. I'm not sure what companies you've developed for, all all the ones I do have a source of commerce - usually via the web. So those who are (and I completely f'ing agree) 'standing still' are also potential customers/clients and dictate (unfortunately) how the web advances, because they are stuck on IE. Newer isn't always better, and HTML5 is a perfect example. You have yet to articulate one positive thing about HTML5 and how <section>s are better than <div>s, and I just gave you a huge reason why they're not. And what you call "designing backwards" is what pros call graceful degradation. You should get over your pride, and see what real developers are actually doing. When HTML5 finishes out and is a final product, it's nothing to learn a few new tags. Until then, you have to go with what works on new and older technology, and if you're busy wasting time on <section> tags, you're missing the point.

  14. #14
    Join Date
    Oct 2012
    Bengough, SK, Canada
    HTML5 can be read by legacy browsers anyway with a simple shiv or modernizers. There are games based on HTML5, storage is smarter, media support is great, list goes on! HTML5 isn't the future, it is here right now. I have yet to come across a reason why I wouldn't want to use HTML5. You can even get rid of flash and even silverlight (crap anyway). Apple is pushing it and it is great for modern mobile devices. It has nothing to do with pride, for me it just makes the most sense is all.

  15. #15
    Join Date
    Sep 2008
    No, I agree. It's great. It has many benefits, but regarding this topic, <section>s aren't one of them. They are useless. Also, modernizer doesn't fix everything.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.11856 seconds
  • Memory Usage 3,018KB
  • Queries Executed 15 (?)
More Information
Template Usage (36):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (75):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates