Implementation: HTMLHTML elements

The main structure of an HTML page makes use of <head>, <title> and <body> tags. Implementation of HTML through use of titles, videos, audio, div, anchor, headings, paragraphs and links provides a solid basis for future implementation.

Part ofComputing ScienceWeb design and development

HTML elements

The remainder of this guide exemplifies use of a range of HTML elements relevant at National 5 level.

<p>...</p>

Defines the fact that a paragraph should be created by the browser. Text within the ˂p˃ and ˂/p˃ tags will appear on screen.

<h1>...</h1>

Creates headings, such as the main title shown on the page. There are six different sizes that can be used, with h1 being the largest and h6 the smallest.

<div>…</div>

The <div> element is used so that CSS styles can be easily applied to a group of elements.

In this example, the font family and colour (color in HTML) of the text within the <div> section would be applied to all elements within the <div>…</div> tags. Both the heading and paragraph would be blue and use a Times New Roman font.

<div style="font-family: “Times New Roman, Times, serif; color:#0000FF"> <h2>Heading</h2> <p>Paragraph of text</p>
</div>