7 The language of the web
Making the web appear in your web browser may be thought of as a special form of application programming. Typically, modern web sites divide this programming into three parts: content, style and behaviour.
The content of a web page is put together using hypertext markup language (HTML), the language of the web, which your browser understands. A browser needs a set of codes to identify the various parts of the web page: the headings, lists, paragraphs and so on. These codes are called tags in HTML and they make it possible for a web page to be displayed in a browser. HTML tags are standardised so that they can be interpreted by different browsers. HTML describes the structure of a web page, but how about formatting the page?
Well-designed web page presentation is vital for readability and appeal. The appearance of a page is greatly simplified by the use of stylesheets. A stylesheet is code used to format a page in a desired way: the presentation information goes in special <style> tags, often as a separate page of code. Indeed, Cascading Stylesheets (CSS) can control the layout of multiple web pages all at once and thus save a lot of work. A style can be added to HTML elements in three ways:
- Inline – literally inline with the HTML, hence formatting and describing the page contents at the same time, all mixed together.
- Internal – by grouping all the formatting commands in to one part of the HTML document into a stylesheet. This simplifies applying the same style across a document, because you need only define it once.
- External – by using an external CSS file, to which each page can link. Now you can apply a common style to all the documents in your website.
There are several other special application languages, such as Structured Query Language for working with databases. You will encounter these if you choose to take your study of computer programming further.