Forum Moderators: open

Message Too Old, No Replies

Which versions of (x)html and CSS to learn?

         

Makaveli2007

1:44 am on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I already have some basic html and css knowledge..however its been a while and Im trying to create a website.

Thus I was wondering which versions of (x)html and CSS I should go to when looking things up/learning things I dont know yet.

- Should I use the latest xhtml version - xhtml 1.1?

- Is it true that xhtml 1.0 is a subset of html 4.01? Meaning all xhtml 1.0 code is html 4.01 code (but all html 4.01 code isn't necessarily xhtml 1.0 code)?

- If that's true, I think I should learn xhtml. However: Should I learn xhtml 1.1 or xhtml 1.0? Is all xhtml 1.1 also valid html 4.01 code?

thanks

tedster

2:10 am on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do not think of xhml as the latest and best - that's not the case. XHTML is not a subset of HTML, it's a version of HTML that conforms to XML syntax. There are some very problematic areas around XHTML. We've discussed this several times on the forum - see:

Why most of us should NOT use XHTML [webmasterworld.com]

My advise is to learn and use HTML 4 strict. Using the strict version instead of transitional is the single best step you can take, even if you do use xhtml. By learning the strict version (even if you sometimes need to back off and create a transitional page) you will gain a much more soldi understanding of exactly what html is and is intended to be.

CSS versions depend mostly on adding new selectors, so if a stylesheet is valid CSS1 then it is also valid as CSS2. The important thing with CSS is whether browsers support the selectors you use, and this improves with every new browser release.

Consistent and non-buggy browser support for CSS was very slow coming, but today you can do very well with almost all of CSS2 [w3.org]. CSS 3 [w3.org] is still under development and not ready for prime time.

Makaveli2007

2:57 am on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks for your replies. Ill read that discussion, now.

Is html 4 strict = html 4.01?

[edited by: Makaveli2007 at 2:58 am (utc) on Nov. 24, 2007]

tedster

3:11 am on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, I did mean html 4.01 strict. There is also html 4.01 transitional, but if you're just learning then you don't have anything to "transition" from.

Makaveli2007

4:33 pm on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Okay, so I'm a beginner and I used to think that xhtml 1.0 strict really is html 4.01 strict (I was told that by a friend who's kind of a computer geek (but not big on the web)).

Thus I was thinking the whole document could stay the same and only the doctype-code-line would have to be replaced (which would take < 1 minute for each document) to go from one to another.

But now I read that XHTML is really HTML 4 in quirksmode?

Does that mean there are things that are different between xhtml 1.0 strict and html 4.01 strict? I found this great tutorial resource which I started yesterday, but its about xhtml 1.0 I think - not html 4.01 so now Im wondering if I'd be better of finding another one.

thanks!

[edited by: encyclo at 4:38 pm (utc) on Nov. 24, 2007]

mehh

5:06 pm on Nov 24, 2007 (gmt 0)

10+ Year Member



Think of them more as seperate markups. XHTML is harsher and every tag must be closed, but in HTML 4.01 you shouldn't close everything. for example
<meta ... />
is invalid in HTML 4.01 but its what you must use in XHTML.

encyclo

6:35 pm on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



XHTML is really HTML 4 in quirksmode

That would be either a misunderstanding, or carelessness with technical terms. "Quirks mode" is used in comparison to "Standards-compliance mode", which are ways of describing rendering modes or how a browser handles markup. Certain factors trigger the browser into using "quirks mode" to render a page (eg. the absence of a doctype), where the handling of the markup deviates from accepted standards and instead renders according to earlier established practices on from old browsers.

XHTML is usually treated by the browser as slightly invalid HTML, but due to the usual presence of a doctype it is nevertheless rendered in standards-compliance mode.

Makaveli2007

10:00 pm on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



So if I understood you right there really are differences (even if they are slight) between valid html 4.01 and xhtml 1.0?

Thus if I want to learn (a 100%) correct html 4.01, I better find a resource for learning html 4.01 and not xhtml 1.0?

tedster

10:12 pm on Nov 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The differences are outlined at W3Schools:

The Most Important Differences:
XHTML elements must be properly nested
XHTML elements must always be closed
XHTML elements must be in lowercase
XHTML documents must have one root element

[w3schools.com...]

W3Schools.com is also a good place to learn html online [w3schools.com] - and other web technologies as well.

mehh

11:34 am on Nov 25, 2007 (gmt 0)

10+ Year Member



I better find a resource for learning html 4.01 and not xhtml 1.0?

Yes. As the technologys evolve they will inevitably grow further apart. Even now XHTML can do things that HTML can't do and looking at the working drafts for HTML 5 and XHTML 2 I can only see them becoming less and less related. I recommend learning HTML 4.01 as it has less teething problems (IE won't show XHTML documents sent as application/xhtml+xml correctly).

Link to the W3Schools HTML Tutorial [w3schools.com]

bluesmandeluxe

2:42 am on Nov 26, 2007 (gmt 0)

10+ Year Member



What it really comes down to is that XHTML was created for and meant to be served as "application/xhtml+xml" - meta tag header for content-type being "content - http-equiv="content-type" content="application/xhtml+xml; charset=utf-8.

However, it was "Permitted" (by short-sighted fools) to be served as "HTML" when the mime type is designated as "text/html" - which in essence renders xhtml 1.0 as HTML ... with strange closing tags. Did anyone really see any point in that?

BUT! Internet Explorer, is incapable of understanding what the "application/xhtml+xml"&#65533; mime type is. So even properly serving XHTML is a recipe for potential disaster.

Most people who initially got fooled into thinking XHTML was the new and future HTML replacement (myself included), used the content-type header meta tag - "content - http-equiv="content-type" content="text/html;charset=utf-8".

And this is where the whole XHTML vs HTML nonsense broke down. Because only xhtml 1.0 is permitted to be served as HTML; XHTML 1.1 and future versions must properly serve it as "application/xhtml+xml" ... which is a content-type that IE doesn't have a clue about - so guess what it does? It blows up.

And the whole issue has resulted in massive confusion from/for beginners to/for stubborn professionals alike.

It has actually become such a hot potato, that were the debates held live and not in forums ... it would come to blows.

The bottom line is this ... use HTML 4.1 strict and you simply can't go wrong.

Don't even LOOK at the mess they are already making of HTML 5! Wait for them to get it right with HTML 5.1.

[edited by: tedster at 2:45 am (utc) on Nov. 26, 2007]
[edit reason] fix a character set issue [/edit]

mehh

4:25 pm on Nov 26, 2007 (gmt 0)

10+ Year Member



Don't even LOOK at the mess they are already making of HTML 5!

I find it quite funny that XHTML 2 needs to learn from HTML 5 and vice versa but they refuse to do so to prevent even more confusion.