Skip navigation
Currently Being Moderated

XHTML versus HTML5

Jun 11, 2012 12:05 PM

Tags: #html5 #xhtml

Hi,

 

I am developing a site for viewers in Europe.

I'd like to decide on the proper doctype declaration:

- What is Adobe's view on this question

<or>

- What would W3C officially recommend for me?

 

Maybe it isn't that straightforward to answer, so my priorities:

- The site has to render quickly, smoothly, and must look nice.

- I am targeting older browsers too as long as they are used by people

- Mobile devices can be a nice addon, but not required

 

Thanks.

 

I found on the web different answers for my problem,

some would say XHTML strict or HTML5. Adobe help

currently tells me XHTML transitional, i don't know

if that info is uptodate now (2012 june).

 
Replies
  • Currently Being Moderated
    Jun 11, 2012 12:21 PM   in reply to AdobeUserHun12

    First, this is a user-to-user forum.  You won't get an official opinion from Adobe or W3C here. 

     

    Doc type depends on what you're doing.

     

    If you want to take advantage of the newer HTML5 tags and support older browsers, you need to add a conditional comment for pre-IE9 with a link to the HTML5 Shiv script on Google's servers.

     

    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    
    

     

     

    Nancy O.

    Alt-Web Design & Publishing

    Web | Graphics | Print | Media  Specialists 

    http://alt-web.com/

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 12:40 PM   in reply to Nancy O.

    I generally recommend that people choose a doctype that is consistent with their coding skills.  Most often, this is HTML4.01 Transitional, which although long in the tooth is still a valid choice.  If your skills allow upgrading that choice, then I would choose HTML5, but that's me.  There is little practical benefit to XHTML other than a) the rigor, and b) the tight coupling with any use of XML in your methods.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2012 6:59 PM   in reply to AdobeUserHun12

    XHTML stands for Extensible Hyper Text Markup Language. Ironically, XHTML has never been extensible. It is restrictive, as Murray has eluded to, forcing developers/designers to work more precisely, having to address issues such as

    • all elements and attribute names must appear in lower case
    • all attribute values must be quoted
    • non-Empty Elements require a closing tag
    • empty elements are terminated using a space and a trailing slash
    • no attribute minimization is allowed
    • in strict XHTML, all inline elements must be contained in a block element

     

    Although HTML is more forgiving, there is no reason not to apply the same discipline to HTML documents.

     

    Many articles have been devoted to the pro's and con's of each language. With the exception of a few minor issues (e.g. larger file size for XHTML due to the empty element termination), there are no performance differences.

     

    Having established that there is no reason not to use HTML, there is no reason why you cannot start using the HTML5 doctype right now. Consider the two following declarations

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    and

    <!DOCTYPE html>

    Both declarations will handle the exact same markup. In HTML5, the validator may issue a few warnings such as the unnecessary use of the type attribute as in

    <script src="myScript.js" type="text/javascript"></script>

    but the markup will work.

     

    Using semantic markup is an added advantage when developing in HTML5, not necessary, but it does open new opportunities in preparation for the future.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2012 11:47 AM   in reply to AdobeUserHun12

    Before you decide to use HTML5, you should learn the new tags and what they do.

    http://www.w3schools.com/html5/html5_reference.asp

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2012 12:01 PM   in reply to Nancy O.

    You might want to look at this

    http://w3fools.com/

     

    The key issue for the typical Dreamweaver user inquiring about HTML5 is

    that for them it simply involves new tags that, on their own, do

    absolutely nothing. The use of a script simply allows old versions of IE

    to do what old versions of the Netscape/Mozilla tree have always done,

    and that is to associate CSS rules with any tag - real or made up.

     

    The cool stuff requires JavaScript but does not even require an HTML5

    DOCTYPE

     

    --

    Al Sparber - PVII

    http://www.projectseven.com

    The Finest Dreamweaver Menus | Galleries | Widgets

    Since 1998

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 7:56 AM   in reply to AdobeUserHun12

    AdobeUserHun12 wrote:

     

    Seems you are suggesting me that if I'd like to code cross-browser compatible,

    I have to use the script Nancy mentioned in her first post. Am I right?

     

    That w3fools link was partly interesting/partly a religion war, as far as my perception goes.

    If you want to take advantage of the new html5 tags such as aside, header, section, naviagtion then you need to use the shiv script so IE below 9 will recognise them.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 26, 2012 12:53 PM   in reply to AdobeUserHun12

    AdobeUserHun12 wrote:

     

    Seems you are suggesting me that if I'd like to code cross-browser compatible,

    I have to use the script Nancy mentioned in her first post. Am I right?

    As Osgood says, only for Internet Explorer versions earlier than IE9.

     

    The script merely ensures that earlier IE versions can recognise HTML5 tags.

     

     

    AdobeUserHun12 wrote:

     

    That w3fools link was partly interesting/partly a religion war, as far as my perception goes.

    Same here. It's a sideshow.

     

    It's usually posted when people are being mischievous.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points