0% found this document useful (0 votes)
17 views59 pages

Trac NG Hiem

The document is a comprehensive HTML, CSS, JavaScript, and PHP quiz consisting of multiple-choice and fill-in-the-blank questions. It covers fundamental concepts, syntax, and best practices related to web development technologies. The quiz is structured into sections for each technology, with a total of 40 questions for HTML alone.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views59 pages

Trac NG Hiem

The document is a comprehensive HTML, CSS, JavaScript, and PHP quiz consisting of multiple-choice and fill-in-the-blank questions. It covers fundamental concepts, syntax, and best practices related to web development technologies. The quiz is structured into sections for each technology, with a total of 40 questions for HTML alone.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 59

HTML Quiz

Question 1 of

40:

1.What does HTML stand for?

2.Who is making the Web standards?

3.Choose the correct HTML element for the largest heading:

4.What is the correct HTML element for inserting a line break?

5.What is the correct HTML for adding a background color?

1
6.Choose the correct HTML element to define important text?

7.Choose the correct HTML element to define emphasized text?

8.What is the correct HTML for creating a hyperlink?

9.Which character is used to indicate an end tag?

2
10. How can you open a link in a new tab/browser window?

11. Which of these elements are all <table> elements?

12. Inline elements are normally displayed without starting a new line.

13. How can you make a numbered list?

14. How can you make a bulleted list?

3
15. What is the correct HTML for making a checkbox?

16. What is the correct HTML for making a text input field?

17. What is the correct HTML for making a drop-down list?

18. What is the correct HTML for making a text area?

19. What is the correct HTML for inserting an image?

4
20. What is the correct HTML for inserting a background image?

21. An <iframe> is used to display a web page within a web page?

22. HTML comments start with <!-- and end with -->

23. Block elements are normally displayed without starting a new line.

24. Which HTML element defines the title of a document?

25. Which HTML attribute specifies an alternate text for an image, if the
image cannot be displayed?

5
26. Which doctype is correct for HTML5?

27. Which HTML element is used to specify a footer for a document or


section?

28. In HTML, you can embed SVG elements directly into an HTML page.

29. What is the correct HTML element for playing video files?

30. What is the correct HTML element for playing audio files?

6
31. The HTML global attribute, "contenteditable" is used to:

32. In HTML, onblur and onfocus are:

33. Graphics defined by SVG is in which format?

34. The HTML <canvas> element is used to:

35. In HTML, which attribute is used to specify that an input field must be
filled out?
7
36. Which input type defines a slider control?

37. Which HTML element is used to display a scalar measurement within a


range?

38. Which HTML element defines navigation links?

39. In HTML, what does the <aside> element define?

8
40. Which HTML element is used to specify a header for a document or
section?

II. CSS

1.What does CSS stand for?

2.What is the correct HTML for referring to an external style sheet?

3.Where in an HTML document is the correct place to refer to an external style


sheet?

9
4.Which HTML tag is used to define an internal style sheet?

5.Which HTML attribute is used to define inline styles?

6.Which is the correct CSS syntax?

7.How do you insert a comment in a CSS file?

8.Which property is used to change the background color?

10
9.How do you add a background color for all <h1> elements?

10. Which CSS property is used to change the text color of an element?

11. Which CSS property controls the text size?

12. What is the correct CSS syntax for making all the <p> elements bold?

11
13. How do you display hyperlinks without an underline?

14. How do you make each word in a text start with a capital letter?

15. Which property is used to change the font of an element?

16. How do you make the text bold?

17. Question 17 of 25:

How do you display a border like this:

The top border = 10 pixels


The bottom border = 5 pixels

12
The left border = 20
pixels The right border =
1pixel?

18. Which property is used to change the left margin of an element?

19. When using the padding property; are you allowed to use negative values?

20. How do you make a list that lists its items with squares?

21. How do you select an element with id 'demo'?

13
22. How do you select elements with class name 'test'?

23. How do you select all p elements inside a div element?

24. How do you group selectors?

25. What is the default value of the position property?

3. JavaScript

1.Inside which HTML element do we put the JavaScript?

14
2.What is the correct JavaScript syntax to change the content of the
HTML element below?

<p id="demo">This is a demonstration.</p>

3.Where is the correct place to insert a JavaScript?

4.What is the correct syntax for referring to an external script called "xxx.js"?

5.The external JavaScript file must contain the <script> tag.

15
6.How do you write "Hello World" in an alert box?

7.How do you create a function in JavaScript?

8.How do you call a function named "myFunction"?

9.How to write an IF statement in JavaScript?

10. How to write an IF statement for executing some code if "i" is NOT equal
to 5?

16
11. How does a WHILE loop start?

12. How does a FOR loop start?

13. How can you add a comment in a JavaScript?

14. How to insert a comment that has more than one line?

17
15. What is the correct way to write a JavaScript array?

16. How do you round the number 7.25, to the nearest integer?

17. How do you find the number with the highest value of x and y?

18. What is the correct JavaScript syntax for opening a new window called
"w2" ?

18
19. JavaScript is the same as Java.

20. How can you detect the client's browser name?

21. Which event occurs when the user clicks on an HTML element?

22. How do you declare a JavaScript variable?

23. Which operator is used to assign a value to a variable?

19
24. What will the following code return: Boolean(10 > 9)

25. Is JavaScript case-sensitive?

4. PHP

1.What does PHP stand for?

2.PHP server scripts are surrounded by delimiters, which?

3.How do you write "Hello World" in PHP?


20
4.All variables in PHP start with which symbol?

5.What is the correct way to end a PHP statement?

6.The PHP syntax is most similar to:

7.How do you get information from a form that is submitted using the "get"
method?

8.When using the POST method, variables are displayed in the URL:
21
9.In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for
strings:

10. Include files must have the file extension ".inc"

11. What is the correct way to include the file "time.inc" ?

12. What is the correct way to create a function in PHP?

13. What is the correct way to open the file "time.txt" as readable?

22
14. PHP allows you to send emails directly from a script?

15. Which superglobal variable holds information about headers,


paths, and script locations?

16. What is the correct way to add 1 to the $count variable?

17. What is a correct way to add a comment in PHP?

23
18. PHP can be run on Microsoft Windows IIS(Internet Information Server):

19. The die() and exit() functions do the exact same thing.

20. Which one of these variables has an illegal name?

21. How do you create a cookie in PHP?

22. In PHP, the only way to output text is with echo.

24
23. How do you create an array in PHP?

24. The if statement is used to execute some code only if a specified


condition is true

25. Which operator is used to check if two values are equal and of same data
type?

25
EXERCISE:

A.HTML

1.What does HTML stand for?

2.Which one of the following headers has the correct HTML syntax?

3.Who invented HTML?

4.What is a correct HTML markup for the document type declaration?

5.HTML elements are surrounded by a specific type of brackets, which one?

6.Fill in the missing code to complete the markup of the HTML hyperlink.

26
7.True or False. Empty elements must have a close tag.

8.Insert the correct end tag for the HTML heading.

9.Insert the correct end tags in this HTML document:

10. Which of the following is a correct syntax for using an HTML attribute?

11. Add a "tooltip" to the paragraph below with the text "About W3Schools".

27
12. Set the size of the image to 250 pixels wide and 400 pixels tall.

13. Make the element below into a link that goes to


"https://www.w3schools.com".

14. Specify an alternate text for the image.

Alternate text is useful when the image cannot be displayed, like when the
page is read by a screen reader.

15. Which of the following headers is the largest and most important header?

16. Use the correct HTML tag to add a heading with the text "London".

28
17. Add six headings to the document with the text "Hello".

Start with the most important heading (the largest) and end with the least
important heading (the smallest).

18. True or False. HTML paragraphs always starts on a new line.

19. Use the correct HTML tag to add a paragraph with the text "Hello World!".

29
20. Clean up this document with proper end tags.

21. Add a horizontal rule between the heading and the paragraph.

22. Add a line break in the middle of the paragraph:

23. Wrap this poem around HTML tags that will preserve all spaces and
linebreaks when the element is displayed.

30
24. What is a correct way to add a background color to an HTML document?

25. Use the correct HTML attribute, and CSS, to set the color of the paragraph
to "blue".

26. Use CSS to set the font of the paragraph to "courier".

27. Use CSS to center align the paragraph.

28. Use CSS to set the text size to 50 pixels.

31
29. Use CSS to set the background color of the document to yellow.

32
30. Use CSS to center align the document.

31. Two of the following HTML elements makes the text bold, which two?

33
32. Add extra importance to the word "degradation" in the paragraph below.

33. Emphasize the word "metropolitan" in the text below.

34. Highlight the word "FUN" in the text below.

35. Apply subscript formatting to the number "2" in the text below.

34
36. Add a line through (strikeout) the letters "blue" in the text below.

37. Which of the following is NOT a quotation element (in fact, not an
HTML element at all)?

38. Use an HTML element to add quotation marks around the letters "cool".

39. The text below should be a quoted section.


Add the proper HTML element to it, and specify that it is quoted from the
following URL: http://www.worldwildlife.org/who/index.html

40. Change text direction.

35
Make the text below go right-to-left.

41. What is the correct syntax for adding a comment in HTML?

42. Use the HTML comment tag to make a comment out of the "This is a
comment" text.

43. Add comment tags around the paragraph:

44. Do you remember any legal HTML color names? Which one of the
following is a legal HTML color?

45. Insert the correct property to make the text color violet.

36
46. The Alpha channel of a color controls the color-transparency, but
which of the following values will be MOST transparent?

47. What is the color of the following text:

48. Insert the correct RGB color values to make the background color
completely blue.

49. Insert the a background color where green has the value 100, red has
the value 106, and blue has the value 205.

50. What is the highest HEX number of the following:

51. Insert the correct HEX value to make the text color white.

52. Which one of the following will result in a grey color?

37
53. Which one of the following color values will reult in a black color?

54. Insert the HSLA value to make a color with no hue, 100% saturation,
50% lightness, and 50% transparency.

55. What does HSL stand for?

56. What is a correct syntax for linking to an external stylesheet?

57. { fillintheblanks: "exercise_html_colors1.htm" },

Use CSS to set the background color of the document (body) to yellow.

38
58. Use CSS to set the font of the document to "courier".

59. Use CSS to set the text color of the document to red.

39
60. Use CSS to make a yellow, 1 pixel thick, border around all paragraphs.

61. What is a correct syntax for an HTML hyperlink?

62. Use the correct HTML to make the text below into a link to "default.html".

40
63. Use the correct HTML attribute to make the link open in a new window.

64. Use the correct HTML to make the image become a link to "default.html".

65. Add a "tooltip" to the link.

The "tooltip" should say "Home".

66. True or False. By default all hyperlinks are underlined.

67. Use CSS to remove the underline from the link.

68. What is a correct syntax for making a link red when you mouse over it?

41
69. What HTML attribute is used to create a bookmark?

70. Add a link to a bookmark, on the same page, with the id="mytext".

71. What is a correct syntax for linking to a bookmark named C4 on another


page?

72. What is a correct HTML element for adding an image?

73. Use the HTML image attributes to set the size of the image to 250
pixels wide and 400 pixels tall.

74. Use CSS to set the size of the image to 250 pixels wide and 400 pixels
tall.

75. Use the correct HTML to make the image become a link to "default.html".

42
76. Make the image below float to the right of the paragraph.

77. Add the correct HTML attribute to display the "smiley.gif" image.

78. Specify an alternate text for

the image. The alternate text

should say "Smiley".

Alternate text is useful when the image cannot be displayed, like when the
page is read by a screen reader.

79. What is a correct HTML element for defining an image map?

80. What is another HTML element used when defining image maps?

81. For image maps, specify a legal value for the area tag's

shape attribute. (Any legal value will give a correct answer)


43
82. What is a correct CSS property for defining background images?

83. To add a background image on an entrire HTML page, on which


element should you specify the background image?

84. Add a background image named "myimage.png" on a HTML element.

85. One of these elements is NOT a legal HTML element, which one?

86.What will be the result if the


browser supports both images?

87. True or False. An <img> element inside a <picture> element wil


always be prioritised before any image defined in a <source> element.
44
88. In which HTML element is the Favicon defined?

89. Which HTML tag is used


to handle the favicon (the
little image to the left in the
browser tab):

90. True or False. Favicons must have the .ico file extension.

91. In which HTML element is the page title defined?

92. Consider this web


page:

45
93. True or False. A page should only have one title element.

94. What is the correct tag name for a table-cell in HTML?

95. What is the correct tag name for a table-row in HTML?

96. Add a table row at the end of the table, with two table cells.

The two table cells should have the value "Eve Jackson" and "94".

97. What is the correct CSS property for styling the border of a table?

46
98 What is the correct CSS code to
turn this table:

99. Use the correct CSS border values to create a solid black 3 pixels
border on a table element.

100. What is the correct CSS property for styling the width of a table?

101. True or False. To specify a table width, you are only allowed to use
percentages as a value.

102. Use CSS styles to make the table 300 pixels wide.

47
103. What is the correct tag name for a table-header in HTML?

104. Add a table row with two table headers.

The two table headers should have the value "Name" and "Age".

105. Add a table caption that says "Names".

48
106. What is the correct CSS property for styling the padding inside table
cells?

107. What is the correct CSS property for styling the space between the table
cells?

108. Use the correct CSS property to add 15 pixels of space between the
cell border and cell content.

The result should look like this:

108 Use the correct CSS property to add 15


pixels of space between the cell border
and cell content. The result should look
like this:

49
109. What is the correct HTML attribute for specifying how many rows a cell
should span?

110. Use the correct HTML attribute to make the second TH element span two
rows.

111. Use the correct HTML attribute to make the first TH element span two
columns.

50
112. What is the correct tag name for list items?

113. Which one is NOT a legal element in HTML?

114. True or False. The list items in ordered lists will be marked with small
black circles by default.

115. What is the correct CSS property to use when defining the style of a
list marker of unordered lists?

116. Add a list item with the text "Coffee" inside the <ul>.

117. Finish the HTML code to make an unordered list.

51
118. Use CSS to display squares instead of bullets.

119. What is the correct HTML attribute to use when defining the type of the
list item marker of ordered lists?

120. Finish the HTML code to make an ordered list.

121. Use the correct HTML attribute to display letters (uppercase ABC) instead
of numbers.

52
122. What is the correct tag name for a description list?

123. Use the correct HTML elements to make a description of each term in
the description list.

124. What is the correct tag name for describing the term of a definition list?

125. Which type of elements takes up the full width available?

126. Name one HTML block element.

127. Name one HTML inline element.

53
128

129. True or False. You cannot align DIV elements side by side

130. One of the following statements is true about the DIV element, which one?

131. True or False. The class name is case sensitive

132. In the <style> section, create a class selector

named "special". Add a color property with the value

"blue" inside the "special" class.

54
133. Add the correct class to make the H1 element red.

134. Add two classes to the H1 element, to make the background pink and the
color red.

135. True or False. The id name is case sensitive

55
136. Add the correct HTML attribute to make the H1 element red.

137. What is the correct HTML element for defining a form?

138. In the form below, add an input field with the type "button" and the value
"OK".

139. In the form below, add two radio buttons, both with the name
"fav_language".

140. What is the correct syntax for opening the form's result in a new browser
tab?

56
141. Add a submit button, and specify that the form should go to
"/action_page.php".

57
142. Specify that the form is submitted using the "POST" method.

143. What is the correct HTML element to group related data in a form and
also, by default, draw a border around it?

144. In the form below, add an empty drop down list with the name "cars".

145. In the form below, add two option elements to the

drop down list. The first option must have the value "Volvo"

The second option must have the value "Ford".

58
146. In the form below, add a text area with the name "note".

59

You might also like