<<

CSS containers: making websites accessible to disabled users

John R Hudson

1 May 2020∗

1 Personal background

I first became interested in page design as a student journalist at university. When I first started using a micro-computer, I was interested in how much time it could save me; when I discovered vector graphics in the mid 1980s, I realised that I could save time and produce quality output by using a computer. In the 1990s I worked with a blind student and learned how I could use my computing skills to make life easier for him. After 30 years of using my understanding to create quality printed documents and more recently PDF files, in 2010 I was inspired by a talk from David Fisher to put these principles to work in maintaining and developing websites.

2 The wider context

Cascading style sheets (CSS), proposed in 1994 by Håkon Wium Lie, who worked at CERN, were first adopted by Microsoft in Internet Explorer 3 and then by Netscape and Opera. These separate the presentation of material on a website from its content and structure as defined by HTML. At the turn of the century, they went out of favour for a number of reasons and development focused on XHTML. But, a few years later, Mozilla, Apple and Opera began working on a new specification for HTML which would meet the needs of modern devices and which would rely on CSS for presentation. This was published in 2011 as a rolling release and work began on a series of rolling updates to CSS to cope with the needs of the new version of HTML and the demands of modern devices.

3 The semantic elements, HTML and CSS

As part of their work, Mozilla, Apple and Opera surveyed a large number of existing websites and concluded that five things, later to be known as the semantic elements, featured in most web pages: a header, a footer, a navigation bar, material which was tangential to the main content and the main content (figure1).

∗Originally intended for presentation at the openSUSE Summit Dublin.

1 h RAatiue sms eyo boeeHM oacmls htcnb civdmore achieved CSS. be and can elements what HTML accomplish redefined to HTML the obsolete using on by rely simply most as attributes ARIA the can. it the if in language text change the of to language the the specify while to form readable W3C human a a alongside as the accepted example, For formally began tions. were developed. work be these and to W3C attributes; continue by WAI-ARIA and 2014 published the in were of Recommendation Guidelines development Accessibility the Content attributes Web on the ARIA 2008 the In monitor. and large Accessibility a on Content and Web the smartphone and a 4 things, website, on many a website achieve a accessing to generate users to for code delay used less the be needed and could also browsers code It on same XHTML. burden the or reducing HTML have. thereby of might they versions aspect earlier presentational than any function than their rather about ambiguity content as some their was far of there as where terms the and, those in function of of presentational functions start a the had sense the redefining which possible, to made those back obsoleting content HTML, jump of the main to implementations Putting the had eye of content. popularity. reader’s main side in the the either grew which in line distance on smartphones next the content then reduced tangential and it laptops any because first and as bar oblong navigation an being to oee,Ihv e ocm cosaywbiegnrto otaewihflyimplements fully which software generation website any across come to yet have I However, uigtefis eaeo h etr,sreshdmvdfo en ls oasquare a to close being from moved had screens century, the of decade first the During nadto,i h eento fHM lmns ubrhv sflacsiiiyfunc- accessibility useful have number a elements, HTML of redefinition the in addition, In maintain to easy and readable more far HTML made elements HTML of redefinition The various in found they which elements existing the all through went Opera and Apple Mozilla, (2010)) Fisher David to (thanks elements semantic five The 1: Figure

Navigation lmn losamcieraal aeadtm ob recorded be to time and date readable machine a allows element Article Footer Header lmn ota cenedrkosta thas it that knows screenreader a that so element 2 lmn a a has element Aside lang="" trbt nbigyou enabling attribute Figure 2: Using a CSS flex container

5 Using the semantic elements

One of the significant weaknesses of the redefined HTML when it was first developed was any means of accurately placing elements on a page; for example, though you were recommended to put the