Web Question
Web Question
Web Question
Level 2
Dr \ Hazem El-Bakry
HTML & XHTML
1. A webpage displays a picture. What tag was used to display that picture?
a. picture
b. image
c. img
d. src
2. <b> tag makes the enclosed text bold. What is other tag to make text bold?
a. <strong>
b. <dar>
c. <black>
d. <emp>
3. Tags and test that are not directly displayed on the page are written in _____ section.
a. <html>
b. <head>
c. <title>
d. <body>
14. Choose the correct HTML tag for the smallest size heading?
a. <heading>
b. <h6>
c. <h1>
d. <head>
15. What is the correct HTML tag for inserting a line break?
a. <br>
b. <lb>
c. <break>
d. <newline>
19. To create a combo box (drop down box) which tag will you use?
a. <select>
b. <list>
c. <input type="dropdown">
d. all of above
20. Which of the following is not a pair tag?
a. <p>
b. < u >
c. <i>
d. <img>
22. The special formatting codes in HTML document used to present content are
a. tags
b. attributes
c. values
d. None of above
24. Some tags enclose the text. Those tags are known as
a. Couple tags
b. Single tags
c. Double tags
d. Pair tags
25. The _____ character tells browsers to stop tagging the text
a. ?
b. /
c. >
d. %
31. The way the browser displays the object can be modified by _____
a. attributes
b. parameters
c. modifiers
d. None of above
36. When should you use path along with file name of picture in IMG tag?
a. path is optional and not necessary
b. when the location of image file and html file are different
c. when image file and html file both are on same location
d. path is always necessary when inserting image
38. Which attribute is used with img tag to display the text if image could not load in
browser?
a. description
b. name
c. alt
d. id
39. Which attribute can be used with BODY tag to set background color green?
a. background="green"
b. bgcolor="green"
c. vlink="green"
d. None of above
40. Which attribute you’ll use with TD tag to merge two cells horizontally?
a. merge=colspan2
b. rowspan=2
c. colspan=2
d. merge=row2
41. A webpage displays a picture. What tag was used to display that picture?
a. picture
b. mage
c. img
d. src
42. <b> tag makes the enclosed text bold. What is other tag to make text bold?
a. <strong>
b. <dar>
c. <black>
d. <emp>
65. HTML document start and end with which tag pairs?
a. <HEAD>….</HEAD>
b. <BODY>….</BODY>
c. <HTML>….</HTML>
d. <WEB>….</WEB>
Question 4:
Which HTML tag is used to define an internal style sheet?
<css>
<script>
<style>
Question 5:
Which HTML attribute is used to define inline styles?
font
styles
style
class
Question 6:
Which is the correct CSS syntax?
body {color: black;}
{body;color:black;}
body:color=black;
{body:color=black;}
Question 7:
How do you insert a comment in a CSS file?
/* this is a comment */
// this is a comment //
' this is a comment
// this is a comment
Question 8:
Which property is used to change the background color?
bgcolor
color
background-color
Question 9:
How do you add a background color for all <h1> elements?
all.h1 {background-color:#FFFFFF;}
h1 {background-color:#FFFFFF;}
h1.all {background-color:#FFFFFF;}
Question 10:
Which CSS property is used to change the text color of an element?
text-color
fgcolor
color
Question 11:
Which CSS property controls the text size?
text-size
font-size
font-style
text-style
Question 12:
What is the correct CSS syntax for making all the <p> elements bold?
<p style="text-size:bold;">
p {text-size:bold;}
p {font-weight:bold;}
<p style="font-size:bold;">
Question 13:
How do you display hyperlinks without an underline?
a {underline:none;}
a {decoration:no-underline;}
a {text-decoration:none;}
a {text-decoration:no-underline;}
Question 14:
How do you make each word in a text start with a capital letter?
transform:capitalize
text-style:capitalize
text-transform:capitalize
You can't do that with CSS
Question 15:
Which property is used to change the font of an element?
font-family
font-style
font-weight
Question 16:
How do you make the text bold?
style:bold;
font-weight:bold;
font:bold;
Question 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?
border-width:10px 5px 20px 1px;
border-width:10px 20px 5px 1px;
border-width:5px 20px 10px 1px;
border-width:10px 1px 5px 20px;
Question 18:
Which property is used to change the left margin of an element?
margin-left
indent
padding-left
Question 19:
When using the padding property; are you allowed to use negative values?
Yes
No
Question 20:
How do you make a list that lists its items with squares?
list-style-type: square;
list-type: square;
list: square;
Question 21:
How do you select an element with id 'demo'?
demo
#demo
*demo
.demo
Question 22:
How do you select elements with class name 'test'?
test
*test
#test
.test
Question 23:
How do you select all p elements inside a div element?
div p
div + p
div.p
Question 24:
How do you group selectors?
Separate each selector with a space
Separate each selector with a plus sign
Separate each selector with a comma
Question 25:
What is the default value of the position property?
absolute
static
fixed
relative
Question 26:
CSS stands for __________
a) Color Style Sheets
b) Cascade Sheets Style
c) Cascade Style Sheet
d) Cascading Style Sheets
Question 27:
In CSS, h1 can be called as _______
a) Selector
b) Attribute
c) Value
d) Tag
Question 28:
In css, “color:red” can be called as _____________
a) Selector
b) Rule
c) Declaration
d) Value
Question 29:
Which of the following attributes is used to specify elements to bind style rules to?
a) id
b) class
c) tag
d) all of the mentioned
Question 30:
Which selector is used to specify a rule to bind a particular unique element?
a) id
b) class
c) tag
d) both class and tag
Question 31:
In CSS, “font-size” can be called as ________
a) Selector
b) Rule
c) Property
d) Property-Name
Question 32:
_________ selectors are used to specify a group of elements.
a) id
b) class
c) tag
d) both class and tag
Question 33:
8. Which of the following tag is used to embed css in html page?
a) <script>
b) <style>
c) <css>
d) <!DOCTYPE html>
Question 34:
__________ has introduced text, list, box, margin, border, color, and background
properties.
a) css
b) html
c) ajax
d) php
Question 35:
Is it the best way to include H1 heading only one time on the web page.
a) True
b) False
JavaScript
Question 1:
Inside which HTML element do we put the JavaScript?
<scripting>
<javascript>
<script>
<js>
Question 2:
What is the correct JavaScript syntax to change the content of the HTML element below? <p
id="demo">This is a demonstration.</p>
document.getElementById("demo").innerHTML = "Hello World!";
document.getElementByName("p").innerHTML = "Hello World!";
#demo.innerHTML = "Hello World!";
document.getElement("p").innerHTML = "Hello World!";
Question 3:
Where is the correct place to insert a JavaScript?
The <head> section
Both the <head> section and the <body> section are correct
The <body> section
Question 4:
What is the correct syntax for referring to an external script called "xxx.js"?
<script src="xxx.js">
<script href="xxx.js">
<script name="xxx.js">
Question 5:
The external JavaScript file must contain the <script> tag.
True
False
Question 6:
How do you write "Hello World" in an alert box?
alertBox("Hello World");
msg("Hello World");
alert("Hello World");
msgBox("Hello World");
Question 7:
How do you create a function in JavaScript?
function = myFunction()
function:myFunction()
function myFunction()
Question 8:
How do you call a function named "myFunction"?
call function myFunction()
call myFunction()
myFunction()
Question 9:
How to write an IF statement in JavaScript?
if i = 5 then
if i == 5 then
if i = 5
if (i == 5)
Question 10:
How to write an IF statement for executing some code if "i" is NOT equal to 5?
if (i <> 5)
if i =! 5 then
if i <> 5
if (i != 5)
Question 11:
How does a WHILE loop start?
while i = 1 to 10
while (i <= 10; i++)
while (i <= 10)
Question 12:
How does a FOR loop start?
for (i = 0; i <= 5)
for (i = 0; i <= 5; i++)
for (i <= 5; i++)
for i = 1 to 5
Question 13:
How can you add a comment in a JavaScript?
'This is a comment
<!--This is a comment-->
//This is a comment
Question 14:
How to insert a comment that has more than one line?
//This comment has more than one line//
<!--This comment has more than one line-->
/*This comment has more than one line*/
Question 15:
What is the correct way to write a JavaScript array?
var colors = (1:"red", 2:"green", 3:"blue")
var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
var colors = "red", "green", "blue"
var colors = ["red", "green", "blue"]
Question 16:
How do you round the number 7.25, to the nearest integer?
Math.rnd(7.25)
rnd(7.25)
Math.round(7.25)
round(7.25)
Question 17:
How do you find the number with the highest value of x and y?
Math.max(x, y)
Math.ceil(x, y)
ceil(x, y)
top(x, y)
Question 18:
What is the correct JavaScript syntax for opening a new window called "w2" ?
w2 = window.open("http://www.w3schools.com");
w2 = window.new("http://www.w3schools.com");
Question 19:
JavaScript is the same as Java.
True
False
Question 20:
How can you detect the client's browser name?
navigator.appName
browser.name
client.navName
Question 21:
Which event occurs when the user clicks on an HTML element?
onchange
onmouseover
onclick
onmouseclick
Question 22:
How do you declare a JavaScript variable?
variable carName;
v carName;
var carName;
Question 23:
Which operator is used to assign a value to a variable?
*
-
x
=
Question 24:
What will the following code return: Boolean(10 > 9)
NaN
false
true
Question 25:
Is JavaScript case-sensitive?
No
Yes