Thursday, 4 September 2008

W3Schools HTML and XHTML tutorials

I just finished going through the W3Schools' HTML and XHTML tutorials. HTML is one of those things that I know, but have never really been a master in. I guess that has to do with the fact that the only time I was actually taught html was in high school. At university we did get a few snippets here and there (I remember Ulrich teaching us CSS) but in general we didn't learn it.

Going through the tutorials was interesting if only because it gave you a nice idea what can be done with just pure (x)html. There are a lot of things I thought were quite new and novel, part of the web 2.0 thing, that I now realise were around for a while. I also really like the reference section and the link to the W3C validators. I'm gonna try to validate any websites I write against those validators from now on.

Wednesday, 3 September 2008

Useful (X)HTML Tags

There are some HTML and XHTML tags which are really useful that I hadn't heard of until recently having a look at the W3Schools tutorial on HTML

The <pre> tag defines preformatted text (i.e. text which preserves spaces, new lines etc..) This can be useful if you have some text whose properties you want to keep
for int i = 0 to 10
print i
next i
The computer tags
Then we have a whole bunch of tags dedicated to displaying computer code and related artifacts. Tags like code (for computer code), kbd (for keyboard input), tt (for teletype text), samp (for sample text) and var (for computer variables. As far as I can tell, all of these, with the exception of the var tag, simply output the text in a monospace font while preserving the formatting (new lines and spaces). The var tag outputs slightly larger text which is bold and italic.

The address tag
The <address> tag is used to display addresses, such as the following

Donald Duck
BOX 555

Actually I don't know why I put this one in the 'useful' category, I haven't really seen it used much at all and it doesn't seem too useful to me anyway, but you never know when it could come in useful

The abbreviations and acronyms tags
I really liked these tags and in fact it's a shame they don't get used more often. Especially in the Computer Science/IT fields. I can't remember the amount of times I've been reading an article, tutorial, job description and had to google a acronym or abbreviation in order to figure out what's being talked about.
e.g. <abbr>

e.g. <acronym>
As you can see, they're kind of like the 'alt' tag of an image or a link.

The bdo (bi-directional override) tag
This has to be the coolest, least used feature of html. Essentially this tag allows you to display text backwards. By putting some text between <bdo dir="rtl"> and the closing bdo tag, the text is reversed.

This text should display backwards.1234567890