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.

xhtml/ html 4 - Advice please.

Featured Replies

Hey, I'm just wondering if anyone could give me some advice on what I should be using and why?

  • html 4
  • xhtml

Would be a great help because I've coded my website in html 4 which has validated well, but always see people building in xhtml 1.1? So was wondering what should I 'must' use and why?

 

Thankyou :)

Hey, I'm just wondering if anyone could give me some advice on what I should be using and why?

  • html 4
  • xhtml

Would be a great help because I've coded my website in html 4 which has validated well, but always see people building in xhtml 1.1? So was wondering what should I 'must' use and why?

 

Thankyou :)

 

You can find out the whole history behind HTML and XHTML at www.w3.org.

 

In brief this is the way I understand it and I'm sure someone will corrent me if I am wrong. Back in the day different browsers were programmed different ways so you had to build a web page 3 or 4 different ways to fit all browsers. This is when the W3 Consortium came in and standardized all HTML tags that could be used in all browsers. It started with HTML but then grew to having CSS for designing your site and xhtml for content and structure. The guidelines I read from author Elizabeth Castro in her book HTML, XHTML, CSS sixth edition was 1)the bigger the site the more important it is you use CSS and XHTML 2)some government agencies require their sites to be accessible to people with disabilities, so you need the power of XHTML and CSS for formatting 3)large commercial sites opt for Transitional XHTML to take advantage of some of the deprecated tags and get the most viewed audience 4)small or personal sites can use HTML and CSS as you can use more tags

 

Bottom line is XHTML did away with some of the designing tags so you would use CSS to design and XHTML to build a content intensive site with good structure...I stick with XHTML and CSS as that seems to be the future.

  • Author
You can find out the whole history behind HTML and XHTML at www.w3.org.

 

In brief this is the way I understand it and I'm sure someone will corrent me if I am wrong. Back in the day different browsers were programmed different ways so you had to build a web page 3 or 4 different ways to fit all browsers. This is when the W3 Consortium came in and standardized all HTML tags that could be used in all browsers. It started with HTML but then grew to having CSS for designing your site and xhtml for content and structure. The guidelines I read from author Elizabeth Castro in her book HTML, XHTML, CSS sixth edition was 1)the bigger the site the more important it is you use CSS and XHTML 2)some government agencies require their sites to be accessible to people with disabilities, so you need the power of XHTML and CSS for formatting 3)large commercial sites opt for Transitional XHTML to take advantage of some of the deprecated tags and get the most viewed audience 4)small or personal sites can use HTML and CSS as you can use more tags

 

Bottom line is XHTML did away with some of the designing tags so you would use CSS to design and XHTML to build a content intensive site with good structure...I stick with XHTML and CSS as that seems to be the future.

 

Thanks, Since i've built my site in html coding 'so to speak'. Will if 'break' my site if I change the doctype? Like ive used tags that arnt allowed.

HTML 4.01 or XHTML 1.0 you can use either at the moment.

 

I would advise not to use XHTML 1.1 as that is supposed to be used with a different content type which doesn't work properly in IE6.

 

HTML 5 is coming in due course; read this topic:-

http://www.webdesignerforum.co.uk/index.php?showtopic=22354

You should be ok as stated above..when I said XHTML I should of been more specific. You can use XHTML 1.0 Transitional and not have any problems. If you add to the site just try to stay away from text formatting like <i> or <b> and format with CSS instead.

You should be ok as stated above..when I said XHTML I should of been more specific. You can use XHTML 1.0 Transitional and not have any problems. If you add to the site just try to stay away from text formatting like <i> or <b> and format with CSS instead.

 

<i> and <b> are ok, well replaced with <em> <strong> respectively.

 

But yeah, all presentation should be handled with css and either html/xhtml for the actual content.

 

The only real mark up difference between the two are the self closing tags

 

html:

<img src="#" alt="#">

 

xhtml

<img src="#" alt="#" />

 

Their are other differences, to do with xml and modularisation, but for the vast majority of websites, html would suffice. Most have opted for xhtml because it forces you to be 'stricter' which helps with interoperability.

 

Personally, just use whichever you feel most comfortable with, but try and use the strict doctype, as transitional is only intended to be used during the transition phase from old code to new.

It does seem that the people who define the standards have changed their direction. We all thought that XHTML was going to supersede HTML but in future there will be two directions, HTML 5 and XHTML 5.

 

Item 1.7 here http://dev.w3.org/html5/spec/Overview.html says "The first such concrete syntax is "HTML5". This is the format recommended for most authors. It is compatible with all legacy Web browsers. If a document is transmitted with the MIME type text/html, then it will be processed as an "HTML5" document by Web browsers."

 

Then it says "The second concrete syntax uses XML, and is known as "XHTML5". When a document is transmitted with an XML MIME type, such as application/xhtml+xml, then it is processed by an XML processor by Web browsers, and treated as an "XHTML5" document. Authors are reminded that the processing for XML and HTML differs; in particular, even minor syntax errors will prevent an XML document from being rendered fully, whereas they would be ignored in the "HTML5" syntax." which means that IE6 will have serious problems and the slightest coding error will cause a blank screen with any browser.

 

It seems that they want us to return to HTML in future, but right now anything using the doctype XHTML 1.0 will be OK and will always be OK provided the XHTML 1.0 doctype still exists, but new websites should move on to HTML 5 eventually.

  • Author

Wow thanks, made it a bit clearer now and I'm going to stick with HTML and I do use a strict doctype because I'm still learning :D

Broadly speaking XHTML insists on strict separation of content and style elements - therefore excluding any inline style elements. It's also much more "strict" in the conventional sense, inasmuch that it requires greater conformity to it's rule set in order to validate and render correctly. For that reason, it is the darling of standardistas - but as Wickham has pointed out, there are issues regarding how IE6 interprets full blown XHTML when served as XML. Still, IE6 is all but dead in the water...

Either way, choose a strict DOCTYPE for your chosen format, and just make you validate.

 

As to the future:

http://xhtml.com/en/future/x-html-5-versus-xhtml-2/#x2-cool

 

As you can see - there are lots of good and bad features about both, but there is something of a battle going on:

 

"HTML 5 Versus XHTML 5

 

In an attempt to finally resolve the HTML versus XHTML debate, the X/HTML 5 spec actually makes the issue more complex to understand. Indeed, the X/HTML 5 spec actually says "generally speaking, authors are discouraged from trying to use XML on the Web", even though W3C continues to herald XML as the future of the Web? This is exceptionally confusing and exceptionally uncool!

A Too Hasty Process

 

X/HTML 5 is a reaction to the slow progress made by W3C in delivering a replacement to HTML 4 and XHTML 1. As a result, the process of developing X/HTML 5 seems rushed, and many feel the spec came out of nowhere and is being fast tracked. Even some of the stakeholders directly involved feel the timelines and milestones for developing the spec are completely unrealistic."

 

Personally, I like the philosophy behind XHTML more, and believe that increasingly specific markup elements present in HTML5, while neat, are a step in a direction I don't wish to go in. Yet, the issue is one of browser support. I'd love to be using CSS3 - but until it's universally available it's going to be something of a novelty unless you really want to double aspects of your workload or leave some of your client's with substandard rendering.

In fact, having read it through more thoroughly, it appears that it's generally advisable to use HTML4 strict - doh! Goddam all those standards books I've been studying...

 

read this:

http://anthologyoi.com/dev/xhtml-vs-html-round-2.html

 

but then again, if you check WSP:

 

http://www.webstandards.org/learn/articles/askw3c/oct2003/

 

 

<sigh>My conclusion: Use XHTML if you really need to use XML/XSLT functionality straight out the tin. Alternatively, just serve HTML4 and write a PHP XML Parser instead...</sigh>

My take on it is that web designers for the general public will have to use a backwards-compatible doctype like HTML 5 while IE6 is still taking above, say, 3% of the browser share (20% at present so it may take a long time to disappear).

 

XHTML 2 or XHTML 5 will not be suitable if used properly with content="application/xhtml+xml" for the general public. They will only be used with confidence in company intranets where all computers are up to date.

 

In the meantime we have HTML 4.01 or XHTML 1.0 both using content="text/html" which are both suitable for the general public.

 

I've actually started using HTML4.01 for my new pages as XHTML 1.0 is called "tag soup" being a half-way house and a dead end.

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.