0% found this document useful (0 votes)
33 views5 pages

CAT Term 2 - QA

This document provides instructions for a 2 hour exam worth 50 points on the topic of Web User Interface. The exam contains 5 questions testing students' knowledge of CSS selectors, calculating element dimensions, styling links and tables. Students are instructed to attempt all questions, write their answers on the question paper, and include their name and class.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

CAT Term 2 - QA

This document provides instructions for a 2 hour exam worth 50 points on the topic of Web User Interface. The exam contains 5 questions testing students' knowledge of CSS selectors, calculating element dimensions, styling links and tables. Students are instructed to attempt all questions, write their answers on the question paper, and include their name and class.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

COURSE: Web User Interface

CAT 1: TERM II Date: 28/02/2024


PERIOD: 2h MARKS: 50 pts
Examiner: Louis MUKAMA

Instructions

1. Attempt all Questions


2. Use this question paper as your answer-shit
3. Make the handling visible
4. Write your respective names and class on the answer-shit

Student names Class


…………………………………………………………………………… ………………………………….
Question 1) Examine the table below to identify which statement is true or false. (1mark for
each item)

Example Example description True or False


.intro Selects all elements with id="intro" F
#firstname Selects the element with class="firstname" F
* Selects only one element F
p.intro Selects all <p> elements with class="intro" T
div, p Selects all <div> elements and all <p> elements T
div p Selects all <p> elements inside <div> elements T
div > p Selects all <p> elements where the parent is a <div> element T
div + p Selects the first <p> element that is placed immediately after <div> T
elements
p ~ ul Selects every <ul> element that is preceded by a <p> element T
[target] Selects all elements with a target attribute T
[target="_blank"] Selects all elements with target="_blank" T
[title~="flower"] Selects all elements with a title attribute containing the word "flower" T
[lang|="en"] Selects all elements with a lang attribute value equal to "en" or starting T
with "en-"
a[href^="https"] Selects every <a> element whose href attribute value begins with "https" T
a[href$=".pdf"] Selects every <a> element whose href attribute value ends with ".pdf" T
a[href*="rca"] Selects every <a> element whose href attribute value contains the T
substring "rca"
p:first-child Selects every <p> element that is the first child of its parent T
p::first-letter Selects the first letter of every <p> element T
p::first-line Selects the first line of every <p> element T
p:first-of-type Selects every <p> element that is the first <p> element of its parent T
p:last-child Selects every <p> element that is the last child of its parent T
p:last-of-type Selects every <p> element that is the last <p> element of its parent T
p:nth-child(2) Selects every <p> element that is the second child of its parent T
p:nth-last-child(2) Selects every <p> element that is the second child of its parent, counting T
from the last child
p:nth-last-of- Selects every <p> element that is the second <p> element of its parent, T
type(2) counting from the last child
p:nth-of-type(2) Selects every <p> element that is the second <p> element of its parent T
p:only-of-type Selects every <p> element that is the only <p> element of its parent T
p:only-child Selects every <p> element that is the only child of its parent T
::selection Selects the portion of an element that is selected by a user T
:not(p) Selects every element that is not a <p> element T

2
Question 2) Consider below code snippets, to calculate the
a) total width of an element (2.5 marks)
b) total height of an element (2.5 marks)
1 div {
2 width: 320px;
3 height: 50px;
4 padding: 10px;
5 border: 5px solid gray;
6 margin: 0
7 }

Question 3) Write CSS code snippets to


a) Remove bullets from an unordered list and display its items inline. (2 marks)
b) Select the first list item using nth-child selector and highlight it with white
background color (3 marks)

3
Question 4) When setting the style for several link states, there are some order rules. Below
are link states:
 a normal, unvisited link
 a link the user has visited
 a link when the user mouses over it
 a link the moment it is clicked
a) Clearly order the above state to comply with the best practice rules (2 marks)
b) Implement with clear source code to the style for several link states (3 marks)

Question 5) HTML tables or lists can be used to display particular data from various sources.
You are required to:
a) Write CSS code to let an HTML table spans the entire screen (2.5marks)
b) Apply CSS to create a zebra-stripped columns on the same table (2.5 marks)

4
5

You might also like