Sei sulla pagina 1di 8

1

Question 1
a. Identify errors in the code below, correct the errors and display the output of the
corrected code [20 marks]

<html>

<head>
<title>HTML Frames<title>
</head>
<FRAMESET ROW="25%, 50%, 25%”
<FRAME name = first SRC="/bottom">
<FRAMESET COL="25%, *">
<FRAME name= second1 SRC="/html">
<FRAME name = second2 SRC="/main">
</FRAMESET>
<FRAME name = third SRC="/top">
</FRAMESET>
</frameset>
</html>

Answer

 The title tag should be closed i.e. </title>


 Frameset should be in lower case
o FRAME is in lower case
o Name attributes are in quotes
o </frameset> should not be repeated

<html>

<head>

<title>HTML FRAMES</title>

Marvellous Muchanyu BMIS 2-2 MIG486


2

</head>

<frameset rows="25%, 50%, 25%">

<frame name = "first"" SRC="/bottom">

<frameset cols="25 %,*">

<frame name = "second1" SRC="/html">

<frame name=”second2” SRC=”/main”>

</frameset>

<frame name = "third" SRC = "/top">

</frameset>

</html>

The output is a frame below

Question 2
a. Describe a hyperlink as it is used in web development [2 marks]

Marvellous Muchanyu BMIS 2-2 MIG486


3

A hyperlink is a unidirectional (moving or operating in a single direction) link in an electronic


document. Hyperlinks can connect two different documents as well as various sections in the same
document. A text enriched with hyperlinks is called a hypertext ( Avison & Fitzgerald, 2003).
b. Expound the html statement below:
<td> <a href=“http://www.google.com ”> <img src="cat.jpg" height= "50" width="100"
alt= "cat" /> </a> </td> [2 marks]

In a table there is a data container <td> that has an image of a cat with height 50, the image has an
anchor element which when clicked with redirect to google.com page.

c. Explain the effects of the following target attributes values [6 marks]

i. _self
Opens the linked document in the same frame as it was clicked (this is default)

ii. _top
Opens the linked document in the full body of the window

iii. _parent

Opens the linked document in the parent frame

Question 3

Marvellous Muchanyu BMIS 2-2 MIG486


4

a. Describe the basic anatomy of a stylesheet using an example


[8marks]

A Style Sheet is a collection of style rules that that tells a browser how the various styles are to be
applied to the HTML tags to present the documentInternal .There are three types of stylesheets
namely
 internal stylesheet, which is placed right on the page whose interface it will affect.
 External which is placed in a separate file.
 Inline which is placed inside the tag it will affect.

The following CSS STYLE declaration puts a border around every H1 element in the document
and centers it on the page.
<HEAD>
<STYLE type="text/css">
H1 {border-width: 1; border: solid; text-align: center}
</STYLE>
</HEAD>

Style Sheets let one selectively override previous defined styles. For example a web site might be
using a standard style sheet but certain web pages can have an additional style Sheet that can
override styles that have been defined in the standard style sheet.

Style sheets can be external or internal to a web site and/or external or internal to a web page. A
style sheet is a text file that is stored on any Web server, within the same location as a web pages
or a style sheet can also be included as part of a web page.

As illustrated below, every cascading style Sheet (whether it is contained in a .css file, or embedded
in the head element of an HTML document) is a series of instructions called statements. A
statement does two things:
 it identifies the elements in an HTML document that it affects
 it tells the browser how to draw these elements

Marvellous Muchanyu BMIS 2-2 MIG486


5

Elements mean paragraphs, links, list items and so on. In technical HTML terms, an element is
anything marked up inside HTML tags. The part of a statement which identifies page elements is
called a selector. Selectors select page elements.

The part of a statement which tells a browser how selected elements should be drawn is called the
declaration. A declaration can contain any number of properties, the individual pieces of style to
be applied to the selected element. An example is as follows

body {
font-family: Verdana, "Minion Web", Helvetica, sans-serif;
font-size: 1em;
text-align: justify;
}
The selector is body. This means that the statement will affect the <body> element of any page
linked to this style sheet.
The statement has a declaration with three properties. That means that any element selected by this
selector will have three of its properties affected. Each property has a name, for example "text-
align" and a value, for example "justify".
This declaration will affect the font used for the <body>, along with the size of that font and the
alignment of the text (Escalona et al, 2004).

b. Give a detailed description of any 2 style rules for CSS [12 marks]

A rule is a statement applying one or more properties to one or more elements. The declaration of
a rule is split in to two parts; the selector and the declaration block, which itself consists of
declarations. Each declaration consists of a property and a value. Rules can be applied to all the
basic HTML elements, for example the <p> tag, or one can define their own variation and apply
them where they wish to.

Here is an example of a rule:

h1 {

Marvellous Muchanyu BMIS 2-2 MIG486


6

color: navy;

border-bottom: 1px solid black;

In the above, h1 is the selector; it specifies the parts of the HTML document that the rule should
be applied to. In this case, it means “all <h1> elements”.

The curly braces mark the declaration block, with the two declarations separated by semi-colons.
Declarations are placed on different lines but this is a coding style thing: CSS ignores whitespace
as a general rule.

The meanings of the two declarations should be self-evident: color: navy (note the American
spelling of “color”) sets the colour of the text to navy blue, while border-bottom: 1px solid black;
adds a 1 pixel wide solid black border to the bottom of the element. This is an example of a
shorthand property which allows several properties to be set at once.

The selector part of a rule specifies which parts of the associated document the rule should be
applied to. Selectors are always positioned at the start of a rule before the open curly brace. More
than one selector can be specified for a single rule, in which case the selectors must be separated
by commas:

/* Make all <h1> and <h2> elements navy blue */

h1, h2 {

color: navy;

The most basic form of selector, demonstrated above, is the element or type selector. It is written
as the tag name of an HTML element and matches all elements of that type.

Marvellous Muchanyu BMIS 2-2 MIG486


7

Each property has a property name followed by a colon and then the value for that property. There
are many different types of value, but any given property can only take certain values as set down
in the specification.

Sometimes a property can take a number of values. The values in the list should be separated by
a comma and a space. Sometimes a value will have a unit as well as the actual value. One must
not put a space between the value and its unit.

As with HTML, white space can be used to make a style sheet easier to read and write. One should
use spaces (Avgerou, 2008).

Marvellous Muchanyu BMIS 2-2 MIG486


8

List of references

Avgerou, C. (2008) Information Systems in Developing Countries: A Critical Research Review.


Journal of Information Technology, 23 (3), 133-146.

Avison, D. & Fitzgerald, G. (2003) Where now for development methodologies? Communications
of the ACM. 46 (1)

Escalona, M.J., & Koch, N. (2004) Requirements Engineering for Web Applications: A
Comparative Study. Journal of Web Engineering, 2 (3), 193-212.
https://wizardassociates.com/what-is-a-webmaster.asp (Accessed on 5 March 2019)

Marvellous Muchanyu BMIS 2-2 MIG486

Potrebbero piacerti anche