Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Should i learn XHTML or HTML5 first? whats the difference?

Featured Replies

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.

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.

  • 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?

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.

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 by Wickham

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.

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.