March 15, 201214 yr Hi guys, completely new to web design/development. I know so far that i need to learn HTML/CSS but was wondering, should i learn XHTML or HTML5?? whats the difference?? its soo confusing. Thanks for any replies! melpa.
March 15, 201214 yr They are both HTML, but written to slightly different guidelines of structure. XHTML is written to XML guidelines, HTML5 is written to SGML guidelines. Most people nowadays code in HTML5, and as it is the next iteration of HTML, it's probably the best one to be using. Some HTML5 features are not widely supported, yet, so make sure you know which ones to use.
March 15, 201214 yr Author Thanks buddy! do you recommend learning HTML at the same time as CSS or should i learn HTML first and when comfortable move on to CSS?
March 15, 201214 yr You can't really do one without the other. Learn your basic markup in HTML first. But start learning CSS pretty quickly and learn both together.
March 16, 201214 yr Renaissance-Design is referring to XHTML 1.0 doctype using a meta tag <meta http-equiv="content-type" content="text/html; charset=utf-8" /> using content="text/html; "Proper" or "pure" XHTML uses content="application/xhtml+xml" and should not be used for normal websites as a single error will cause the page not to display at all, apart from possibly an error message. Proper or pure XHTML is reserved for specialist applications like SVG and MathML. Whichever way XHTML is written, you should use lower case for element and attributes names and close tags properly ie some unclosed tags like <br> should be <br /> and also meta tags, input tags and img tags closed with /> instead of only > Read this http://dev.w3.org/html5/spec/Overview.html#html-vs-xhtml Edited March 16, 201214 yr by Wickham
March 16, 201214 yr You can't really do one without the other. Learn your basic markup in HTML first. But start learning CSS pretty quickly and learn both together. Learn XHTML first as the coding standard is stricter. I stand corrected! Not really. It's still a confused situation. What I'm doing is using HTML5 doctype but using XHTML coding standards, ie lower case element and attributes names and closing tags properly. Validators don't raise any errors whether you use HTML or XHTML coding standards, but a warning is raised that HTML5 is not yet the official standard (which is still HTML, not XHTML, for normal websites). Confused? Item 1.6 in http://dev.w3.org/html5/spec/Overview.html#html-vs-xhtml says "The first such concrete syntax is the HTML syntax. This is the format suggested for most authors." but it seems sensible to use teh XHTML coding standards.
March 16, 201214 yr Pretty much the same as above. I like the way XHTML is done, everything seems more 'proper' to me. But i do use an HTML5 doctype.
March 17, 201214 yr I agree with y'all. I'm a firm believer that starting with XHTML strict makes you better when you switch to HTML5. Just because HTML5 allows a lot of sloppiness doesn't mean you should write sloppy markup!
Create an account or sign in to comment