Articles Tagged with “Html”
16/07/2008: Extending hCard with RDFa
hCard is an HTML-based format for describing contacts (people, organisations, etc) on web pages. It allows you to mark up which elements represent their name, their address, their birthday and so forth.
While hCard offers many useful properties that can be used to describe contacts, some are considered beyond the scope of the hCard specification. This is where RDFa comes in…
09/03/2008: The Semantic Web
One of my current interests is the semantic web — that is, the push to move from publishing text on the Web to publishing structured data, which can actually be understood by computers (in so far as a computer can truly “understand” anything). By publishing information so that computers can understand it, you make the Web into a huge mine of interconnected data, free to be queried by everyone.
As an example of what I mean, searching for the keyword “train” on Google brings up results related to:
- trains, as a form of transport
- the band Train
- IT training courses
- toy trains
In the semantic web, the search engine and my computer would inherently understand the difference between these concepts, so if I wanted to know about the new Train album, I wouldn’t get any result related to locomotives!
What I’m particularly interested in is ways of embedding semantic data in ordinary web pages, so that we have a single web that can be…
09/03/2008: The Great IE8 Meta Tag Climb Down
Yeah, so I know I’m about a week late in mentioning this (I’ve been busy — let’s hope nobody is using this blog as their primary source of news), but the Microsoft Internet Explorer team have backed down on their ridiculous META tag idea.
Read about it on IEblog.
06/02/2008: The Great IE8 Meta Tag Debacle
So Microsoft, in conjunction with some of the folk at WaSP, has announced its intention to include the quirks mode that beats all quirks modes in the forthcoming Internet Explorer 8 in an article on A List Apart: Beyond DOCTYPE: Web Standards, Forward Compatibility, and IE8.
This has proved to be quite a controversial idea. It was not long before WaSP issued a release hinting that many WaSP members do not support the idea. Speaking in favour of the scheme we have:
- In Defense of Version Targeting by Jeffery Zeldman
- From Switches to Targets: A Standardista’s Journey by Eric Meyer
And against, we have…
22/01/2008: CSS to HTML Compiler
I’ve searched around the ‘Net for something like this before, but without success, so decided to write my own. The basic idea is this: there are certain circumstances in which you need to write some styled HTML without access to the document’s header. For example, when composing HTML-formatted e-mails, which may be displayed in a web-based e-mail client; when adding content to limited content-management system; or in an eBay auction description. In such a situation, you can’t (validly) include a <link rel="stylesheet"> element, nor a block (if you do include such a construct it may just about work, but the document will not be valid), so instead you are reduced to using HTML style attributes all over the place.
However, it is slow work using style attributes as you can’t take advantage of CSS selectors. Instead…
02/08/2007: Open Mobile Alliance DTD Oops!
The Open Mobile Alliance, who are responsible for co-ordinating the web-browsing efforts of mobile phones, seem to have misplaced xhtml-mobile12-model-1.mod. This file is a key part of the DTD for the latest version of their XHTML Mobile Profile standard, which defines how authors should construct web pages intended for the consumption of mobile phones. Now that it’s missing, all pages that reference the XHTML Mobile Profile 1.2 DTD are instantly invalid. Oops!
Oh, and the corresponding files for versions 1.0 and 1.1 of the standard have also gone astray.
20/07/2007: Parsing an HTML Table with PEAR’s XML_HTMLSax3
Here’s an example of how to parse an HTML table into an array using the PEAR module XML_HTMLSax3. It supports the <tr>, <td> and <th> elements and the rowspan and colspan attributes…
18/07/2007: PHP Linkifier
Here’s a nifty bit of code I wrote a while back (utilising a function from PHP SmartyPants) that takes a bunch of HTML, searches it for some word or phrase that you specify, and turns all occurances of it into a link, unless it’s already a link!…
21/05/2007: The Tao of HTML 5 - Part II
Part of the problem with the WHATWG HTML 5 specification is that it’s primarily written by browser makers. (Hixie, its editor, is the exception, as he currently works for Google, though in the past was employed by the Mozilla Foundation and Opera.)
This has steered the focus of the specification towards browser manufacturers — the specification includes such things as algorithms for parsing markup. To expect a typical document author to care about such details, let alone understand them is a triumph of optimism over sanity.
Understanding Motivations
The aim of most browser makers is to increase their market share — to attract users, the browser must enable them to view any documents they could in their old browser, plus tempt the user with an array of new features and improvements. Naturally this leads to a situation where browsers are…
20/04/2007: Ogg Theora Support in Opera 9.5
In Hâkon Wium Lie’s latest missive on Opera Labs he details Opera’s upcoming support for the <video> element in HTML 5. He points out that it’s not much use without at least one defacto standard web video format (much like JPEG, GIF and PNG have become for the <img> element.
A preview release of Opera 9.5 includes native support for Ogg Theora (the free video format from the people that brought you Ogg Vorbis and Ogg FLAC) — which to me seems to be a step in the right direction. The current preview is Windows-only, but Theora’s LGPL library is widely supported cross-platform, so Linux and Mac previews are surely not too far away.
HTML 5 similarly includes a <audio> element. Will the other Ogg formats see native support in Opera?
In other news, Opera’s internal builds implement CSS text-shadow. See Rijk’s blog.
15/04/2007: The Tao of HTML 5
On the 10th of June 1215, the a group of English barons invaded London and five days later forced King John to attach his seal to the Magna Carta in Runnymede, on the border of modern-day Sussex and Berkshire. (In those days it was customary to attach ones seal to an agreement rather than sign it. However the fact that it was not signed has led to a popular misconception that King John was illiterate, when in fact he was not.)
The Magna Carta was a key document in English constitutional law, establishing certain rights (such as habeas corpus) for the King’s subjects, and limiting the rights of the King; importantly, requiring the King to obey “the law of the land”. The Magna Carta is widely regarded as a major influence on world constitutional law, and in particular greatly influenced the “United States…
20/02/2007: Re: Views on XHTML 1.1 site
The upcoming revision to the XHTML 1.1 spec gets savaged on Usenet.
15/02/2007: Re: Web Design: Would you design a PDF by writing Postscript in Notepad?
fgdg wrote:
Why do we put up with web design software? Nobody makes a PDFs by writing Postscript in Notepad, but that is what designer’s working for the web are expected to do.
You are comparing apples with oranges here. PostScript is1 a language for describing what pages look like. HTML is a language for describing what pages mean.
19/09/2005: On Custom DTDs
Dylan Parry wrote:
Of course, but validating against a custom, non-standards controlled DTD is a complete waste of time for HTML. That would be validation for validation’s sake. If you can’t validate against a recognised doctype then there is truly no point in attempting to create your own to cover your problems
Using a custom DTD can be very useful.
Abbreviations
There are two HTML elements for dealing with abbreviations: <acronym> and <abbr>.
So what’s the difference? Although it is generally agreed that any shortening of a word or phrase is an abbreviation, and that some abbreviations are acronyms, there are two schools of thought on deciding exactly which abbreviations are acronyms…
source2html
I needed to print out a directory full of small scripts. This Perl script will go through the current directory and create a pretty HTML page of all the files in that directory. That HTML page can then be fed to a browser for printing.
#!/usr/bin/perl
$cd = `pwd`; chomp $cd;
$ls = `ls -1 $cd`;
@ls = split(/\n/,$ls);
print "<title>Directory Listing $cd</title>\n";
print "<h1>Directory Listing $cd</h1>\n";
$ll = `ls -l '$cd'`;
chomp $ll;
print "<pre style='padding:1em'><b>$ll</b></pre>\n\n";
foreach $f (@ls) {
if (!(-d $f)) {
$l = `ls -l '$f'`; chomp $l;
print "<div style='border:2px solid black;padding:1em;'>\n";
print "<h2 style='margin:0;padding:0;'>$f</h2>\n";
print "<pre><b>$l</b></pre>\n";
print "</div>\n";
$t = `cat '$f'`;
$t =~ s/&/&/g;
$t =~ s/</</g;
$t =~ s/>/>/g;
print "<pre style='padding:1em'>$t</pre>\n\n";
}
}
This software is distributed under the terms of the GNU GPL.
19/10/2003: On Web Design
local wrote:
Now I wonder how important cross-browser coding actually is. How many browsers do I have to test, which versions?
I have two philosophies on this question.
The first is the philosophy I apply when making my own website — I stick to the standards and let any browser that can’t handle it be damned. If 99% of browsers don’t work on it, that’s fine by me. (OK, so I have added a few little workarounds for IE6, but nothing major)
The second philosophy is similar and is what I use for other people’s websites. Again, write to standards, but make sure it works more or less perfectly in:
- IE 5+ (Windows)
- Netscape 6+
- Opera 7+
- Konqueror
and make sure the content is readable and the site is navigatable in:
- Netscape 4.x
- IE 4 (Win)
- IE 5 (Mac)
- Opera 5+
- Lynx
Now, the best way to do this, is to follow my smiple (sic) 7 point design
procedure:
1. Content
Start with the content. It may be cliche to say so nowadays, but content really is king.
2. Markup
Mark up the content…