Docsity

XHTML and CSS Practice Final Exam Solutions - Prof. Michael R. Kowalczyk, Exams of Computer Science

Toggle sidebar
bg1
CS-101 Fall 2008 Section 4 Practice Final v1.0M
Name: Model solution
Exam Format:
Multiple Choice, True/False, Short Answer (3 points each – 75 points total)
Write-the-page (25 points)
XHTML/CSS Reference:
Entities:
Copyright symbol ©
Less-than sign <
Greater-than sign >
Space  
Quotation marks "
CSS Properties:
font-family
font-size
padding
padding-left
padding-right
padding-top
padding-bottom
background-color
color
border-width
border-style
border-color
margin
margin-left
margin-right
margin-top
margin-bottom
border-collapse
top
left
right
position
width
height
Pseudo-classes:
a:link
a:visited
a:focus
a:hover
a:active
pf3
pf4
pf5
pf8

Partial preview of the text

Download XHTML and CSS Practice Final Exam Solutions - Prof. Michael R. Kowalczyk and more Exams Computer Science in PDF only on Docsity!

CS-101 Fall 2008 Section 4 Practice Final v1.0M

Name: Model solution

Exam Format:

Multiple Choice, True/False, Short Answer (3 points each – 75 points total)

Write-the-page (25 points)

XHTML/CSS Reference:

Entities:

Copyright symbol © Less-than sign < Greater-than sign > Space
Quotation marks "

CSS Properties:

font-family font-size padding padding-left padding-right padding-top padding-bottom background-color color border-width border-style border-color margin margin-left margin-right margin-top margin-bottom border-collapse top left right position width height

Pseudo-classes:

a:link a:visited a:focus a:hover a:active

Multiple Choice, True/False, Short Answer (3 points each – 75 points total)

1) T/F: The following line of markup is valid in XHTML 1.0 strict.

2) T/F: The following markup is valid in XHTML 1.0 strict.

3) T/F: The head and body elements both belong nested inside the html element.

4) T/F: To get an img element to validate as XHTML 1.0 strict, an alt attribute is required.

5) Which of the following is not an element used in a table? a) td b) th c) tb d) tr

6) T/F: A web page must be on a web server in order to be "on the Internet".

7) T/F: A relative URL is preferable to an absolute URL when linking to files on your own website.

8) On your friend's computer you see that a website folder has both .html and .css files in it. Before getting any further information, you have already determined that the website (1) using external CSS and (2) using embedded CSS. Fill in the blanks. a) (1) is likely to be, (2) is not b) (1) must be, (2) is not c) (1) must be, (2) might be d) (1) is likely to be, (2) might be

9) Which of the following is not a valid value for the type attribute of an input element? a) get b) text c) hidden d) submit

10) What term below describes how many times a particular webpage has been requested? a) Pings b) Page views c) Site visits d) Uploads

15) What does the following CSS rule apply to?

div p { background-color: #555555; }

a) All div elements that are nested inside a p element b) All p elements that have id="div" c) All p elements and all div elements d) All p elements that are nested inside a div element

16) Given the following CSS and XHTML fragments, what color is hello and goodbye?

CSS Fragment: div { color: blue; } p { color: red; } span { color: green; }

XHTML Fragment

Hello

Goodbye

a) Hello is red, goodbye is green b) Hello is blue, goodbye is red c) Hello is red, goodbye is red d) Hello is blue, goodbye is green

17) What is the primary intended purpose of the p element?

a) To change the font. b) To markup a paragraph of text (and inline elements). c) To show off one's "HTML skills". d) The p element has no real purpose.

18) Suppose you made modifications to your webpage but you don't see any changes in the browser. Name a possible cause of the problem.

Could be a caching issue, viewing the wrong version (local versus server), didn’t refresh the browser, or forgot to save the document.

19) Why do we use elements such as em and strong when we could get the same visual effect via CSS?

Separation of content and style; em and strong indicate emphasis and strong reading of the text. Stylistic changes with CSS (such as making a whole paragraph italics) do not indicate such emphasis. More practically, screen readers may read it in a different voice if it is em or strong.

20) What is the purpose of the style element?

We have used the style element to include embedded CSS in an XHTML document.

21) Someone says they have "commented out some of their markup". Specifically, what are they talking about?

They used to temporarily remove some of their markup, making it so it’s still there in the .html file, but it doesn’t show up in the browser anymore.

22) Name one advantage and one disadvantage of using .png instead of .jpg

Advantages of .png files include lossless compression and transparency. Disadvantages include less browser support and larger file size.

23) In terms of accessibility, name at least one physical and one technology-based limitation that may effect a user's experience when visiting a website.

Physical limitations may include color-blindness, blindness, impaired hearing, or difficulty controlling a mouse. Technological limitations may include a slow Internet connection, low screen resolution, low color depth, or an old browser.

24) Convert the decimal number 171 into hexadecimal.

Dividing 171 by 16 yields 10 with a remainder of 11. In hexadecimal, 10 is A and 11 is B, so the hexadecimal equivalent of 171 is AB.

25) Convert the hexadecimal number 56 into decimal.

Multiplying 5 by 16 yields 80, and then add in 6 to get 86.

Mantis Shrimp

**Mantis Shrimp Facts Incredible facts:

They can strike hard enough to break acquarium glass!

They can see UV and even polarized light.

Links

Wiki for mantis shrimp
Image gallery

Eye has trinocular vision and can be moved independently. **

/* This side of the page is the style1.css file */

#photo {

position: absolute;

background-color: #b0ffb0;

top: 0;

right: 0;

border-color: #ff0000;

border-style: double;

border-width: 3px;

padding-left: 70px;

padding-right: 70px;

width: 200px;

.highlight {

background-color: #ffff00;

h1 {

font-family: "Baskerville old face", serif;

a:link, a:visited, a:focus, a:hover, a:active {

color: #005500;

body {

background-color: #b0b0ff;

margin-right: 346px;