a.) All main headings should be italicized. h1 {font-style: italic;} Use an ordinary selector. HTML will need no alteration.

Similar documents
Introduction to using HTML to design webpages

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

Introduction to WEB PROGRAMMING

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

This is an open-book, open-notes, open-computer exam. You may not consult with anyone other than the instructor while working on this exam.

Tutorial 4: Creating Special Effects with CSS

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

LECTURE-3. Exceptions JS Events. CS3101: Programming Languages: Javascript Ramana Isukapalli

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Chapter 7 Typography, Style Sheets, and Color. Mrs. Johnson

CSS Styles Quick Reference Guide

Want to add cool effects like rollovers and pop-up windows?

Proper_Name Final Exam December 21, 2005 CS-081/Vickery Page 1 of 4

Reading 2.2 Cascading Style Sheets

Introduction to Web Tech and Programming

How to lay out a web page with CSS

How to create and edit a CSS rule

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

8a. Cascading Style Sheet

CSS. Lecture 16 COMPSCI 111/111G SS 2018

NAVIGATION INSTRUCTIONS

Appendix D CSS Properties and Values

CSS Lecture 16 COMPSCI 111/111G SS 2018

The Benefits of CSS. Less work: Change look of the whole site with one edit

CSc 337 LECTURE 3: CSS

1 of 7 11/12/2009 9:29 AM

CSS: Cascading Style Sheets

Introduction to DHTML

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Creating your first website Part 4: Formatting your page with CSS

CSS Cascading Style Sheets

CSS: The Basics CISC 282 September 20, 2014

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28

Using CSS in Web Site Design

CSS worksheet. JMC 105 Drake University

Html basics Course Outline

Cascading Style Sheets (CSS)

Taking Fireworks Template and Applying it to Dreamweaver

Zen Garden. CSS Zen Garden

First Name Last Name CS-081 March 23, 2010 Midterm Exam

Using Dreamweaver CS6

CSS.

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

CSE 154 LECTURE 3: MORE CSS

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

Lab Introduction to Cascading Style Sheets

Student, Perfect CS-081 Final Exam May 21, 2010 Student ID: 9999 Exam ID: 3122 Page 1 of 6 Instructions:

Controlling Appearance the Old Way

EECS1012. Net-centric Introduction to Computing. Lecture 3: CSS for Styling

CSS: Formatting Text. CSS for text processing: font-family. Robert A. Fulkerson

Guidelines for doing the short exercises

JS Tutorial 3: InnerHTML Note: this part is in last week s tutorial as well, but will be included in this week s lab

Introduction to CSS. Part 1: Simple Text Formatting. Source Files for this Exercise are available on the Course Website DW_CSS intro

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

Events: another simple example

Fundamentals of Website Development

ITSE 1401 Web Design Tools Lab Project 4 (Expression Web 4 - Units M, N, O, P) Last revised: 1/9/14

Microsoft Expression Web Quickstart Guide

Pearson Education Limited Edinburgh Gate Harlow Essex CM20 2JE England and Associated Companies throughout the world

Cascade Stylesheets (CSS)

Web Structure and Style. MB2030 Section 2 Class 4

Creating Forms. Starting the Page. another way of applying a template to a page.

Problem 1: Textbook Questions [4 marks]

CMPT 165: More CSS Basics

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

HTML and CSS COURSE SYLLABUS

Cascading Style Sheets Level 2

Web Designer s Reference

LING 408/508: Computational Techniques for Linguists. Lecture 14

CSC 443: Web Programming

CISH-6510 Web Application Design and Development. Overview of JavaScript. Overview

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

Using Advanced Cascading Style Sheets

Dear Candidate, Thank you, Adobe Education

JS Lab 1: (Due Thurs, April 27)

Cascading Style Sheet Quick Reference

DAY 4. Coding External Style Sheets

Styles, Style Sheets, the Box Model and Liquid Layout

CSC309 Programming on the Web week 3: css, rwd

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

BIM222 Internet Programming

Place User-Defined Functions in the HEAD Section

Creating and Building Websites

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

Transcription:

This is an open-book, open-notes exam. FINAL EXAMINATION KEY MAY 2007 CSC 105 INTERACTIVE WEB DOCUMENTS NICHOLAS R. HOWE All answers should be written in your exam booklet(s). Start with the questions that you know how to do, and try not to spend too long on any one question. Partial credit will be granted where appropriate if you show your work. You will have two hours and twenty minutes. Good luck! 1. Cascading Style Sheets (24 points) Devise an appropriate rule or rules for the following situations. In each case, write a sentence explaining why you chose the particular selector used, and whether the HTML tags will need any identifying characteristics (class, id, etc.) added to it to to make the rule apply. a.) All main headings should be italicized. h1 {font-style: italic;} Use an ordinary selector. HTML will need no alteration. b.) All link text should change color to gray when the mouse is moved over them. a:hover {color: gray;} Use a pseudoclass selector. HTML will need no alteration. c.) The document should display a background image, from the file pattern.jpg. body {background-image: url("pattern.jpg );} Use an ordinary selector. HTML will need no alteration. d.) Text identified as a URL should be printed in a typewriter font (e.g., Courier)..url {font-family: Courier, Helvetica, sans-serif;} Use a class selector. HTML tags will need to add class="url". e.) The company logo, which is an image appearing on every page of a site, should have a dotted yellow border around it, five pixels wide. #logo {border: dotted yellow 5px;} Use an id selector. HTML tags will need to add id="logo". f.) In an ordered list with sublists (i.e., nested lists), the sublist items should be labeled using lowercase letters. (For example, in this exam the questions are labeled with numbers, and question parts are labeled with lowercase letters.) ol ol li {list-style-type: lower-alpha;} Use a nested selector. HTML tags will need no alteration.

2. Document Object Model (20 points) Consider the following fragment of HTML. For each question, you should write one line of Javascript that will achieve the desired effect when executed (inside a function, for example). <img id="me" src="me.jpg" style="position: relative; height: 80px; width: 80px;" /> <div id="d1" style="position: relative"> <ol id="list"> <li id="item1">cogito</li> <li id="item2">ergo Sun</li> </ol> </div> Example: Double the width of the image. document.getelementbyid("me").style.width = "160px" a.) Make the text in the list 18 millimeters tall. document.getelementbyid("list").style.fontsize = "18mm" b.) Change the image source to you.jpg. document.getelementbyid("me").src = "you.jpg" c.) Make the image move 3 inches to the right. document.getelementbyid("me").style.left = "3in" d.) Change the text of the second list item to read Ergo Sum. document.getelementbyid("item2").innerhtml = "Ergo Sum." e.) Make the image disappear (not display itself). document.getelementbyid("me").style.display = "none" 3. Dynamic HTML (12 points) Identify by name the event(s) that could be triggered by the following action. If the action cannot trigger any event at all, write the word None. a.) The user presses the mouse while the cursor is over a button that is not part of a form. onclick (& onmousedown, onmouseup) b.) The user presses the mouse while the cursor is over a text input box. onfocus c.) The user types in a text input box and presses Enter. onchange (& maybe onsubmit)

d.) The user moves the mouse over an image. onmouseover e.) The user presses the mouse in the background of the page. onclick (& onmousedown, onmouseup) f.) The user presses the browser s Stop button as the page is being loaded. onabort 4. Conditionals (12 points) Suppose that you are making a web site that will play a dreidel game. (A dreidel is a four-sided top with a Hebrew letter on each side: SHIN, HEY, GIMEL, NUN) You want to simulate a spin of the top, and have the name of one of these four letters appear in your page. Part of the script has been written for you, but you will need to fill in a conditional script. <script> var side = Math.floor(Math.random()*4)+1 document.writeln('the dreidel shows: ') if (side == 1) { document.writeln('shin') } else if (side == 2) { document.writeln('hey') } else if (side == 3) { document.writeln('gimel') } else { document.writeln('nun') } </script> 5. Functions (12 points) You want to create a rollover effect for two images. In the sample fragment below, the boxed letter A through P represent places where something must be filled in to complete the working effect. Some of these items must be the same in order for the effect to work properly file names, element ids, and variable names all may appear more than once. You have two tasks. First, group together the items that must be the same. Second, indicate any items that must be placed in quotes (not counting the quotes already shown). Example: A and C must be the same; neither should be in quotes. <script> function swap(a,b) { document.getelementbyid(c).src = D } </script>

<img id="e" src="f" onmouseover="swap(g,h)" onmouseover="swap(i,j)" /> <img id="k" src="l" onmouseover="swap(m,n)" onmouseover="swap(o,p)" /> F and J must be the same; J must be in quotes. L and P must be the same; P must be in quotes. E and G and I must be the same; G and I must be in quotes. K and M and O must be the same; M and O must be in quotes. B and D must be the same; neither should be in quotes. H and N need not be the same, but should both be in quotes. 6. Forms and Cookies (12 points) Consider the form below. It will be submitted via one of the two submit buttons. <form action="invoice.html" method="get"> <select id="price" name="price"> <option value="19.95">regular ($19.95)</option> <option value="22.95">deluxe ($22.95)</option> </select> <button type="submit" id="one" name="one" value="yes">buy One</button> <button type="submit" id="two" name="two" value="yes">buy Two</button> </form> a.) List the four result strings this form could generate.?price=19.95&one=yes?price=19.95&two=yes?price=22.95&one=yes?price=22.95&two=yes b.) Assume that the customer is ordering one item. Write a script that would read the cost, and store it in a variable called total. You may use the form processing functions provided in class. (Hint: Don t forget to use Number() to convert string values.) var total = formvalue( price ) c.) Suppose that the total value of this customer s previous purchases is stored in a cookie called PurchaseHistory. Write a script that would add the amount in total to the value stored in this cookie. setcookie( PurchaseHistory,total+getCookie( PurchaseHistory )) 7. Design (12 points) The internal state of a page should be indicated in its external appearance. If the internal state changes, the external appearance should change accordingly. Discuss, giving reasons and at least two examples. The internal state of a page refers to any information the page has collected, as well as the potential actions the page offers to the user. Changing the display to reflect the

internal state provides important feedback to the user. For example, moving the mouse over a hot spot changes the internal state of the page, because clicking the mouse will now cause something to happen that wouldn t have happened beforehand. With more complicated interactions, changing the display prevents the user from becoming confused. For example, in a shopping site, if the price total does not update when the user selects a new item, the user may become confused about how much they have spent.