Results 1 to 7 of 7

Thread: XHTML and HTML5

  1. #1
    Join Date
    Jul 2013
    Glasgow, Scotland

    XHTML and HTML5

    After a day or so spent wrestling with a problem - it's time to seek help from those with much more savvy than myself, which is probably most, I am not a native coder and neither am I overly familiar with the way CSS renders things all over a webpage...and many other technical aspects and get by with a lot of trial and error...

    Now, that's out of the way, let me continue. I recently resurected an old project which seen a Joomla site converted into static XHTML, complete with CSS and javascript files for whatever was required and much work with the pages, removing any PHP and tons of other redundant tags, messing about with replacement external javascript things like image rotators and further making sure the sites original java functions were operational also - Then more messing about validating the various pages via the WC3 site until all passed. Great!

    Well, recently I copied and pasted a chunk of code from a HTML5 page into an XHTML page, linked all relevant CSS and after a lot of fiddling about, eventually got the pasted code lined up underneath the original pages menu and it looks cool, the pasted code is actually a newspaper themed layout, complete with custom fonts and css.

    It looks really good and is exactly what I had in mind when starting out, however, when I validated with WC3 it returned about a dozen errors, relating to the tags of the HTML5 code mostly. I understand that the document itself is XHTML1 Transitional and the validator is looking for specific mark up, so <header> for example rings alarm bells.

    I know such a project is probably bordering on lunacy, however the Joomla site created the perfect layout I wanted and all is pretty much good so far, but there is 2 things that have gave me cause to worry - and that is having to learn how to somehow convert the entire site (or about 10 seperately styled pages at least) from XHTML to HTML5, which sounds a nightmare as there are a load of CSS files and java functions in use, or is it more viable to somehow convert HTML5 code to work within an XHTML document?

    I won't go into too much else for now - I know it's a wacky sort of subject but any help or advice would be very much appreciated.


  2. #2
    Join Date
    Aug 2006
    You've got those two options, and a third would be to test the site on the particular browsers you care about, and see if it works ignoring the validation results.


  3. #3
    Join Date
    Jul 2013
    Glasgow, Scotland
    Quote Originally Posted by tracknut View Post
    You've got those two options, and a third would be to test the site on the particular browsers you care about, and see if it works ignoring the validation results.

    Mnay thanks for the reply Dave. The pages in question render fine in ie9 and FF6, all looks good so I suppose ignoring is certainly an idea but I would like to try and figure out how to re-write the HTML5 code that was pasted into the XHTML document in order to make the document pass validation. I imagine it involves altering the corresponding HTML5 style sheet and also changing HTML5 tags to XHTML tags wherever they may be.

    Knowing there are validation issues, such as incorrect mark up, would just annoy me too much, so i'll persevere down the route of altering the HTML5 code - how do i convert HTML5 code into XHTML ? I guess that's the question I need to figure out at the moment, and again, I would be extremely grateful for any help or advice regarding such. I really, really want this thing to validate!


  4. #4
    Join Date
    Aug 2006
    Keep in mind that html5 is a superset of x/html, so depending on what html5 features are used in the code, converting them backwards could be difficult. But if it's just that you've used things like <header> and <nav>, you should be able to replace those tags with appropriately styled <div> tags, and accomplish the task.


  5. #5
    Join Date
    Jul 2013
    Glasgow, Scotland
    Thanks again Dave, i have tried adding the div tag to the <header> tag but i am a wee bit unsure of how to structure this particular syntax into XHTML syntax, daft, i know but i tried a few ways to no avail however - however i have begun changing a test page to HTML5 and am left with just 2 errors after fixing a bunch of others - the two remaining errors are telling me there is an unclosed elements -- Line 78, Column 9: End tag for body seen, but there were unclosed elements. </body>) -- and the other error is; Line 19, Column 26: Unclosed element div. <div id="wrapper_bg">

    Now, if i add a trailing slash, the HTML5 validation tells me to drop the trailing slash - as it is XHTML mark-up, thats understandable but i'm going round in circles I think...i think i will begin mass conversion to HTML5 probably if thats the way to go but i guess i am struggling with the syntax and structure of XHTML and HTML5, this is where the 'trial and error' method hits a brick wall but i think i'll be in better shape if i can learn some more - im just not finding this part so easy...

    Many thanks again,


  6. #6
    Join Date
    Jul 2013
    Glasgow, Scotland
    Quick update - i added a </div> tag near the bottom of the page (there are a couple of others there too) and all is working via the HTML5 validator

  7. #7
    Join Date
    Aug 2006

Thread Information

Users Browsing this Thread

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

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.11788 seconds
  • Memory Usage 2,905KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (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
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (7)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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 (70):
  • 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_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
  • 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