gaoluinn

scríbhinní ⁊ deocháin do chuallucht na Gaelainne

go to main article

HTML and Semantics: the Bare Basics

Author: Mícheál Ó Lochlainn, Áras Shorcha Ní Ghuairim, Acadamh na hOllscolaíochta Gaeilge, Ollscoil na hÉireann, Gaillimh.

Published: 23rd April 2016.

Updated: 26th May 2016.

Keywords

WYSIWYM, WYSIWYG, semantic, HTML.

How HTML works

Web pages are electronic documents containing nothing but plain text, and it written in a computer language called HTML. This language puts structure on the web page by marking-up its content with various tags that have semantic meaning.

Like the bailiffs, these tags generally come in pairs; marking the start and end of content elements: <h1>this is a main heading</h1>, <p>this is a paragraph</p>, <q>this is a quotation</q>, <em>this is emphasised</em> (as in spoken emphasis — <em>don't</em> eat that dog food!), <strong>this is of strong importance</strong> (drinking Domestos <strong>will kill you</strong>) and so on…

The visual presentation of the content on screen is managed (styled) by a different Web technology called CSS, which bases its styling on the HTML tags. Headings are rendered in larger text than paragraphs and are emboldened. Paragraphs are rendered in simple body text. Quotes are put under inverted commas, emphasis is italicised and strong importance is emboldened.

HTML also has ways to store background information about the content 'under the bonnet'. For instance, <p lang="en">this paragraph is in English</p> but <p lang="ga">is i nGaelainn athá an ceann so</p>. This information can be used to apply different styling to different classes of content, to make them stand out from each other. It can also be used to improve search results.

Why semantic HTML matters

So that's the right way to do it. It gives the Web page and its content a defined structure that makes it meaningful to everyone, from human beings with the use of their eyes to human beings that don't have that luxury to all kinds of electronic readers (including those used by the blind) and automated data mining programmes.

Sadly, there's also plenty of wrong ways to do it and, sadly, there's a lot of it about. For example, since <em>emphasising</em> a piece of text has the effect of italicising it on screen, some web authors and web authoring software developers think it is fine to use it to provide one-size-fits-all italics: he reads <em>The Daily Rag</em>, <em>Canis familiaris</em> is man's best friend, she forgot her <em>aide-mémoire</em>, hush now and go to sleep, <em>a stóirín mo chroí</em>… You get the idea. Not a problem if you're a person; who reads text by looking at it; but for everyone — and everything — else, it all comes across a bit like Brian Blessed in The Black Adder.

go to main article