A-level Computing 2009/AQA/Computer Components, The Stored Program Concept and the Internet/Webpage Design/Web page construction



 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.

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

Tags
Web pages are built out of tags. These tags define what is on the page and how it should be structured. There are two types of tags that you can use, and all tags should be written in lower case.

On line one you can see the first type, it has an opening tag  something in the middle "A book About Computing" and a closing tag. This tells us that everything between these tags should be treated as a level one heading (h1).

On line two you can see the second type of tag, there is no closing tag, the tag is entirely self contained. The  stands for a horizontal rule, a line across the page.

Search Engine Optimisation
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.

Draw a web-browser display for the following:

Notice that the  appears as the title of the browser window, but the   is not visible to the user. It is merely there to help web search engines categorise the page.

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 vaste 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 programming language behind interactive websites
 * PHP

Block-level tags
Block tags allow you to give a tag attributes such as padding and margin. This allows you to insert tags into various parts of a page and rely on the other elements there to move to make space for it without worrying about overlap. The tags you need to know are:


 * - headings
 * - horizontal rules
 * - paragraphs
 * - make a new line,
 * - ordered lists
 * - unordered lists
 * - list items
 * - div

Horizontal Rule
- puts a horizontal line across the page where ever you are, useful for breaking up pages

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:

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

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:
 * Unordered Lists
 * give you a list made up of bullet points

the code above would give you:

As you can see above the individual list items are contained within the  brackets.

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.

A Break, creates a new line.

Inline tags
These don't take up any physical space on the page (they don't cause a new line) and can overlap each other. They are: produces the following:
 * - break the page into sections but don't create new lines,
 * - make text bold,
 * - make text itallic,
 * - create a link or an anchor,
 * produces the following:link
 * - add an image



Let's take a look at a quick example:

The output of the above is as follows:

As you can see the layout of the HTML code doesn't always reflect how it will look on screen, remember even if your code looks like it has line breaks, if you don't use block-level tags such as  or a   you won't get any breaks.

Now it's time to test your knowledge:

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  and ending in   is a comment. A comment block start with  and ends with   and you can have as many comments as you like between those tags, as long as they start and end with. Everything in between these comment tags will not be displayed on the screen, producing this:

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.