Final Exam Review PDF
Final Exam Review PDF
Final Exam Review PDF
HTML
Mozilla
Google
Microsoft
The World Wide Web Consortium
<h1>
<heading>
<head>
<h6>
<lb>
<break>
<br>
<body bg="yellow">
<background>yellow</background>
<body style="background-color:yellow;">
6. Choose the correct HTML element to define important text
<strong>
<b>
<important>
<i>
<i>
<italic>
<em>
<a url="http://www.w3schools.com">W3Schools.com</a>
<a href="http://www.w3schools.com">W3Schools</a>
<a>http://www.w3schools.com</a>
<a name="http://www.w3schools.com">W3Schools.com</a>
^
*
<
/
<table><head><tfoot>
<table><tr><td>
<table><tr><tt>
<thead><body><tr>
12. Inline elements are normally displayed without starting a new line.
True
False
<ul>
<dl>
<ol>
<list>
<ol>
<list>
<dl>
<ul>
<input type="check">
<check>
<checkbox>
<input type="checkbox">
16. What is the correct HTML for making a text input field?
<textfield>
<input type="text">
<input type="textfield">
<textinput type="text">
<input type="list">
<list>
<select>
<input type="dropdown">
<input type="textbox">
<input type="textarea">
<textarea>
<body style="background-image:url(background.gif)">
<body bg="background.gif">
<background img="background.gif">
True
False
There is no such thing as an <iframe>
22. HTML comments start with <!-- and end with -->
True
False
23. Block elements are normally displayed without starting a new line.
True
False
<meta>
<head>
<title>
25. Which HTML attribute specifies an alternate text for an image, if the image
cannot be displayed?
src
alt
title
longdesc
a) <title>
b) <body>
c) <src>
d) <html>
a) linked
b) outlined
c) inline
d) ordered
28. Which tag begins a new paragraph?
a) <br />
b) <para>
c) <p>
d) <sp>
29. The margin style requires 4 numbers which correspond in order to:
30. To create a table cell that spans two rows and three columns at the same time,
youenter the <td> tag as ____.
a) <section>
b) <span>
c) <div>
d) <class>
a) SGML
b) HTML
c) W3C
d) XML
CSS
1. What does CSS stand for?
<script>
<css>
<style>
styles
style
font
class
6. Which is the correct CSS syntax?
body:color=black;
body {color: black;}
{body:color=black;}
{body;color:black;}
color
bgcolor
background-color
all.h1 {background-color:#FFFFFF;}
h1.all {background-color:#FFFFFF;}
h1 {background-color:#FFFFFF;}
10. Which CSS property is used to change the text color of an element?
fgcolor
color
text-color
11. Which CSS property controls the text size?
text-style
font-style
font-size
text-size
12. What is the correct CSS syntax for making all the <p> elements bold?
p {text-size:bold;}
p {font-weight:bold;}
<p style="text-size:bold;">
<p style="font-size:bold;">
a {decoration:no-underline;}
a {underline:none;}
a {text-decoration:no-underline;}
a {text-decoration:none;}
14. How do you make each word in a text start with a capital letter?
text-transform:capitalize
You can't do that with CSS
text-transform:uppercase
font-weight:bold;
font:bold;
style:bold;
17. How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?
padding-left
margin-left
indent
19. When using the padding property; are you allowed to use negative values?
No
Yes
20. How do you make a list that lists its items with squares?
list: square;
list-style-type: square;
list-type: square;
demo
*demo
#demo
.demo
22. How do you select elements with class name "test"?
#test
test
*test
.test
div.p
div p
div + p
relative
absolute
static
fixed
JavaScript
1. Inside which HTML element do we put the JavaScript?
<javascript>
<js>
<script>
<scripting>
2. What is the correct JavaScript syntax to change the content of the HTML element
below?
Both the <head> section and the <body> section are correct
The <body> section
The <head> section
4. What is the correct syntax for referring to an external script called "xxx.js"?
<script name="xxx.js">
<script href="xxx.js">
<script src="xxx.js">
msgBox("Hello World");
alert("Hello World");
msg("Hello World");
alertBox("Hello World");
7. How do you create a function in JavaScript?
function = myFunction()
function:myFunction()
function myFunction()
call myFunction()
call function myFunction()
myFunction()
'This is a comment
<!--This is a comment-->
//This is a comment
10. How to insert a comment that has more than one line?
v carName;
var carName;
variable carName;
=
-
*
x
First Question: Short answer
1- Write code to create an ordered list with 2 items.
<ol>
<li> apples</li>
<li> bananas</li>
</ol>
<ul>
<li> apples</li>
<li> bananas</li>
</ul>
○ A browser: is a program that can retrieve files from the World Wide Web
and render text, images, or sounds encoded in the files.
i.e. Apache
○ Inline style
○ Embedded style
○ External style
6- Describe the following with an example:
A- Elements:
Elements are written with a start tag, with an end tag, with the content in
between:
<tagname>content</tagname>
Example:
<p>.......</p>
B- Attributes:
Example:
7. What is W3C ?
The World Wide Web Consortium (W3C) is an international community that develops
open standards to ensure the long-term growth of the Web.
8.The Box model describes the structure of page elements as they are laid out on the web page. List three
components of the box model.
1. Padding
2. Margins
3. Border
9. Name three attributes of the <link> tag.
10. Specify the code to mark the main heading on your Web page.
<h1>content</h1>
11. Specify the code you would use to display the seasons of the year (Winter, Spring,
Summer, and Fall) as an unordered list.
<ul>
<li>Winter</li>
<li>Spring</li>
<li>Summer</li>
<li>Fall</li>
</ul>
12. What code would you enter to display the following text as a paragraph in your Web page? Include
both the block-level and inline element tags.
13. Specify the code you would enter to display the text “Product List” as an h2 heading,
centered horizontally on the page.
14. Specify the code you would enter to mark the text “Hamlet by William Shakespeare”
as a centered h1 heading with a line break after the word “Hamlet.”
15. You want to add the graphic file portrait.gif to your Web page as an inline image.
For nonvisual browsers, your page should display the text “David Vinet” in place of
the image. Specify the code to do this.
16. Specify the code you would enter to display the text “<h2>Hamlet</h2>“ on your Web page.
<h2>Hamlet</h2>
17.Specify the code for marking the text “CAMshots FAQ” as an h2 heading with the id “faq.”
18. Specify the code to enter the following comment into a CSS file:
19. Specify the code to set the text color of every paragraph element within the Web page to red.
p {color: red}
20. Specify the style declaration to display all h3 headings with both an overline and an underline.
21. What attributes do you add to the <img /> tag to set the size of the image to 200
pixels wide by 100 pixels high?
23. Specify the style declaration to set the right and bottom margins of the photoImage
inline image to 5 pixels each.
24. You want your paragraphs to have a padding space above and below the paragraph
equal to 10 pixels. Specify the style declaration to do this.
25. Write the HTML code for a custom button consisting of the image “back.gif” and the text
“Home Page”.
<button type=”button”>
Home Page
</button>
26. Write the HTML tag and code for a Submit button with the label “Assignment” on it.
27. Write code to create an ordered list with 2 items and with capital roman numeric labels.
<li> red</li>
<li> green</li>
</ol>
28. Rewrite this code as strict-DTD-compliant code:
<body>
</body>
<body>
<div>
</div>
</body>
29. In CSS, define the style to be used for headings hn, where:
for n even,
for n odd,
30. Write the HTML for a semantic link to an external CSS style sheet called “mystyle.css”.
31. Write the HTML code for a selection list with three options: VISA, AMEX and MCARD.
<select >
</select>
Section 3: Short Code Programming
1. A web page has three sections: top, middle and bottom. Write style sheet definitions for
• the top section is in blue font, except for <h1> tags, which have green font;
<style type=”text/css”>
</style>
2. Write some code for a web page that has links to www.uqu.edu.sa and www.ccg.uqu.edu.sa Provide
a rollover effect so that these links change size when the mouse cursor is moved over them.
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<br />
<a href="http://www.uqu.edu.sa">UQU</a>
<br />
<a href="http://www.ccg.uqu.edu.sa">CCG</a>
</body>
</html>