Question for web programing
Question for web programing
2. Which of the following is the correct file extension for HTML files?
A. .htm
B. .html
C. Both A and B
D. .web
✅ Correct answer: C
10. The content shown in the browser is placed between which tags?
A. <title> and </title>
B. <html> and </html>
C. <body> and </body>
D. <head> and </head>
✅ Correct answer: C
11. Which tag is used to emphasize text with stress (for screen readers)?
A. <strong>
B. <em>
C. <b>
D. <i>
✅ Correct answer: B
22. Which tag is used to create a horizontal line across the page?
A. <line>
B. <hr>
C. <break>
D. <hl>
✅ Correct answer: B
23. Which element is used to define important text?
A. <b>
B. <strong>
C. <em>
D. <i>
✅ Correct answer: B
26. To define a background color for the entire page, which tag should include the
style attribute?
A. <title>
B. <html>
C. <head>
D. <body>
✅ Correct answer: D
27. Which tag is used to make text appear smaller than normal?
A. <tiny>
B. <small>
C. <shrink>
D. <low>
✅ Correct answer: B
28. Which tag pair creates the visible structure of a web page?
A. <meta> and </meta>
B. <title> and </title>
C. <body> and </body>
D. <style> and </style>
✅ Correct answer: C
30. What is the correct syntax to set a font family in an element using inline styles?
A. font-family="Arial"
B. font="Arial"
C. style="font-family: Arial;"
D. style="font=Arial;"
✅ Correct answer: C
34. Which of the following is the correct format to set background color to yellow?
A. bgcolor="yellow"
B. style="background-color: yellow;"
C. background="yellow"
D. style="color: yellow;"
✅ Correct answer: B
42. What is the correct filename for a default home page in a basic website
structure?
A. home.html
B. main.htm
C. start.html
D. index.htm
✅ Correct answer: D
43. Which tag is used only in the <head> section and helps search engines
understand the page?
A. <meta>
B. <title>
C. <body>
D. <p>
✅ Correct answer: A
44. Which of the following statements about <b> and <strong> is true?
A. Both tags make text bold, but <strong> adds semantic importance.
B. <b> is obsolete and should never be used.
C. <strong> is a CSS property, not an HTML tag.
D. <b> means the text is more important than surrounding text.
✅ Correct answer: A
Chapter (2)
1. Which of the following is the correct way to write a comment in HTML?
A. // This is a comment
B. /* This is a comment */
C. <!-- This is a comment -->
D. <comment>This is a comment</comment>
Correct Answer: C
5. Which value of the alpha parameter in RGBA makes the color fully transparent?
A. 0
B. 1
C. 255
D. 100%
Correct Answer: A
11. Which CSS property adds space inside the border of an element?
A. margin
B. spacing
C. border-spacing
D. padding
Correct Answer: D
12. What is the function of the alpha channel in RGBA or HSLA colors?
A. It defines the color temperature
B. It determines brightness
C. It sets the opacity level
D. It adds texture
Correct Answer: C
13. Which property is used to add space outside the border of an element?
A. margin
B. padding
C. spacing
D. outline
Correct Answer: A
16. What is the correct syntax for specifying an RGBA color with 50% opacity?
A. rgba(255, 0, 0, 50%)
B. rgba(255, 0, 0, 0.5)
C. rgba(255, 0, 0, 128)
D. rgba(255, 0, 0)
Correct Answer: B
24. Which CSS property defines the outermost spacing around an element?
A. padding
B. border
C. outline
D. margin
Correct Answer: D
26. What’s the max value you can assign to a color channel in RGB?
A. 100
B. 255
C. 360
D. 999
Correct Answer: B
28. Which CSS property defines the border thickness and color?
A. border-style
B. border-width
C. border
D. outline
Correct Answer: C
30. Which of the following is NOT a valid way to declare a color in HTML/CSS?
A. color:rgb(255, 255, 255);
B. color:#ffffff;
C. color:hsl(0, 100%, 100%);
D. color:lightdark;
Correct Answer: D