GCSE Computing/HTML

Web pages are now an essential part of how many people live their lives and perform their jobs. More and more computer functions are now moving to web based applications and it is important that you are familiar with this technology.

How to learn about HTML
The easiest way to learn about HTML is to make a few web pages. If you have a program like Dreamweaver make sure that you use the Code view, and don't just drag items on to a page as if it is a fancy word processor. A good site for getting the idea of the tags explained below is http://www.w3schools.com/html/ and use their excellent "try It Out" feature.

Structure of a web page
You might have made some web sites at secondary school using WYSIWYG editors such as Front Page and Dreamweaver. For the A-Level Computing course we are going to take a look at the code that these editors produce, and how to structure webpages with code. Open this wikibook page in any browser and click  in Firefox / Chrome or   in Internet Explorer, you should have the webpage code in front of you.

All web pages have the following basic structure: Which can be represented in HTML code using the following Tags:
 * HTML - specifies that this is a web page
 * Head - contains the title of the page with code and css includes
 * Body - displays the main page content

Explanation of a Tag
Web pages are built out of tags. These tags define what is on the page and how it should be structured.

Simple tag example
The tag is made up of these parts:


 * All tags should be written in lower case.

Tags which Self-Close
Some tags are slightly different, for example images For these there is no closing tag. There is more about this later.

Tags which do not appear on the screen
Some tags are supposed to be used in certain locations on a webpage and have special functions that may not result in any change to the content or layout of that page. There are special tags reserved to help a webpage get found and ranked by search engines. These tags live in the  section of a webpage.
 *  Come to my site first  - this places a title on the top of the browser (NOT the top of a web page)
 *  - so that search engines can better categorise web pages, they know what the site is about
 *  - you used to be able to add keywords to tell search engines what a site was about. This was open to abuse as web site designers just chucked in all the words they could think of and this method isn't used much any more, however, you still need to know it.

Example Web Page
Draw a web-browser display for the following:

What is the top most level tag on a website:

Write the code to create a webpage that has the banner title of "Moogle - shopping site" and has a meta description of "The best site in the world".

how might you use the  section of a web page to increase the page's ranking in search engines?

Block-level tags
A block level tag is just a tag which will display something on the screen, and start a new line before it. An inline tag (see below) does much the same but without starting a new line.

Most Important Block Level tags, used a lot

 * - headings
 * - Div
 * - paragraphs

Other Commonly used tags

 * - ordered lists
 * - unordered lists
 * - list items
 * - horizontal rules

Headings
- heading tags make any text between the tags a heading, the higher the number (h#) the less significant the heading The code above produces the following:

Heading 1

Heading 2

Heading 3

For all following examples the html, body and head tags have been missed. This doesn't mean they don't exist and if you code it you must include them.

Draw out what the following code would produce: {{CPTAnswer|

Years

Year 12

Year 13

Staff

{{CPTAnswer| Introduction

My Life

My Cats

My Dogs

Barry

Aubrey

Rex

Theories

Conclusions

}} Write the code to produce the following headings: Output Devices

Monitors

Speakers

{{CPTAnswer| }}

Team

Goalies

Defenders

Midfield

Strikers

Rooney

Socrates

Stadia

Old Trafford

{{CPTAnswer| }} {{Robox/Close}}

Lists
There are 2 types of list that you need to know, ordered lists and unordered lists. Each has individual list items that hold all the data. the code above would give you: the code above would give you: As you can see above the individual list items are contained within the  brackets.
 * Unordered Lists
 * give you a list made up of bullet points
 * apples
 * oranges
 * pears
 * 1) apples
 * 2) oranges
 * 3) pears

Write HTML to create the following lists:
 * Geoffrey
 * Bungle
 * Zippy
 * George


 * 1) Wittgenstein
 * 2) Augustine
 * 3) Heidegger
 * 4) Marcel

What would the following code output:

What is wrong with the following code to print an ordered list:

Breaking pages up
A Div element is used to divide a web page into sections  - this takes up space on a page and the page will appear larger the more of them you place in. A paragraph, allows you to structure your text like you would if you were writing an essay

Inline tags
These are pretty much the same as Block tags, but they don't cause a new line

Most Important Inline Tags

 * - create a link or an anchor,
 * - add an image
 * - break the page into sections,

Old fashioned Tags that you should NOT use
(Because you should use CSS instead.)
 * - make text bold,
 * - make text itallic,
 * - make a new line,

Hyperlinks
The output of the above is as follows:

BBC News

Images
The output of the above is as follows:

There has to be an image called "Googlelogo.png" in the same folder as your webpage for this to work.

Example with several tags at once
The output of the above is as follows:

Ditty

I tell you naught for your comfort, Yea, naught for your desire, Save that the sky grows darker yet And the sea rises higher

- G.K.Chesterton, The Ballad of the White Horse (1911)

As you can see the layout of the HTML code doesn't always reflect how it will look on screen. Remember the only time you start a new line is when you meet a  or a   or other block level element.

Exercises
Write the code to produce the following output:

Hello how are you?

I'm fine

thank you

This is a link to the bbc website.

The Quick Brown Fox

Jumped over the Lazy Dog


 * Bold
 * Link to google
 * Itallic

Write the code to create the following page linking an image called  with the text "This is a picture of a cat:"

Write the code to create the following page linking an image called  to the page This picture of a dog links to my college's website:

What does the following code produce: Quoted from: Merton, Thomas. (1969). The Way of Chuang Tzu. New York: New Directions.

Quoted from: Tarkovsky, Andrei (1989). Sculpting in Time. University of Texas Press

Write the full html page code for the following webpage:

Car heaven

Welcome to the car site


 * Cars
 * Vans
 * Bikes

This week 30% discount

Write the full html page code for the following webpage, where the image address is:  with alt text of   and the web address is:

-->

Comments
Sometimes you want to write something in the HTML code of a webpage to help you understand the code better. This is called a comment and is an ubiquitous feature in any computing language. Comments don't perform any computing function and don't display on a finished Web page, they are merely there for the web designer to use so that they can understand the page better. For HTML we use the following tags: In the example above, the line starting with the  is a comment. Everything in this tag will not be displayed on the screen, producing this:

What Love is

"Love means to love that which is unlovable; or it is no virtue at all."

For the following code sketch what it outputs

The web is full of free resources to skill yourself up and there is nothing to stop you becoming a top notch web designer. The questions here are suitable to get you through this course with some added elements. If you want to get really good at the vast array of web technologies out there you should be looking to teach yourself. A great place to get started is the w3schools website where you can take courses in: If you want to learn about the code that builds dynamic webpages, including Facebook, check out:
 * HTML
 * Javascript, the language behind interactive websites
 * PHP

What we have been learning so far are the very basics of web design. If you like what you've been doing you better check out HTML5. HTML5 is starting to make websites fully interactive with the ability to quickly embed videos and interact with web pages. Over the next few years you'll increasingly see applications moving over to this new technology, so get with the program and start learning at w3schools.