skip to main content

Jim Byrne Accessible Website Design Glasgow for The Third Sector, Voluntary, Charities and Not for Profits

Accessible design for the Third Sector
Creating inclusive websites since 1996
Jim Byrne Web Designer

A short introduction to HTML Markup and document structure

An HTML document is one that has been divided into its logical parts (i.e. headers, paragraphs, lists, images, quotes and so on) and those parts have been ‘marked up’ with short labels. The labels are called tags. The combination of tags and the text within those tags is called an HTML ‘element’.

Most structural ‘elements’ of an HTML document are enclosed within two tags – an opening tag and a closing tag. It is a good idea to think of elements as containers, e.g. the

tells that browser that this is the start of a paragraph and

tells the browser that this is the end of the paragraph; the text is contained within the start and end tags.

Why is labeling the structure of a document a good thing?

Documents ‘marked up’ correctly will work for people using a variety of different browsers and computers. The logical structure of the document will always be displayed correctly – but the presentation (i.e. the look of the page) can be left to the browser or a style sheet.

HTML documents are divided into two main sections; the head section and the body section. The head section contains meta information; which is information about the document. The most important meta information is the title of the document – as represented by the title element.

The body section contains the content of the document, i.e. the bits that are displayed by the Web browser.

The entire document is enclosed (or contained) within HTML tags; an openingand a closing.

Block and Inline Elements

Elements in the body part of the document can be divided into ‘Block’ elements and ‘Inline’ elements.

Block elements – defined distinct blocks of text, typically preceded and followed by a line break – and stretching the full width of the page. Paragraphs, headers, and blockquotes are block elements.

Inline elements are elements that appear within the flow of the text, e.g. strong, a, em, img.

Here is a summary showing the hierarchical nature of HTML documents:

 

 

Main heading

A paragraph of text with an inline element .

 

Subheading

Another paragraph of text with an inline element .

 

Inline elements are nested within block elements, block elements are nested within the BODY element, and the BODY element is nested within the HTML element.

Understanding the hierarchical nature of HTML is important if you want to create accessible Web pages – and is the key to really understanding what HTML documents are and how they work. You need to write valid, standards based HTML documents for Cascading Style Sheets (CSS) to work properly. If you are using style sheets to format your pages, incorrect nesting of elements, or invalid HTML can lead to unexpected results.

Some common HTML Elements

Paragraphs:

some text

Headers: some text were n = a number 1 to 6.

Blockquotes:

some text

Links: link text

Images:

Unordered Lists:

  • list text

Deprecated elements

Some of the attributes I have mentioned above are now ‘deprecated’ in HTML 4 by the World Wide Web Consortium (W3c). This means that they may be made obsolete in future versions of HTML. Users are discouraged from using them because similar or better results can be obtained by using style sheets.

However they are still legal attributes and can be used alongside style sheets to ensure that a page ‘degrades’ gracefully on browsers that do not support style sheets. A full list of deprecated elements and attributes can be found on the W3c Website.

Contact us today to discuss your website

Or phone to talk over your ideas: 0141 576 9446.

Other posts in this category

Give me a phone if you would like me to test the accessibility of your website:

I provided feedback on the WCAG 2 (as representative of Guild of Accessible Website Designers) have two decades of experience and worked with hundreds of organisations.

07810 098 119