0% found this document useful (0 votes)
7 views

Question for web programing

The document contains a series of questions and answers related to HTML and CSS, covering topics such as HTML tags, attributes, and CSS properties. Each question includes multiple-choice options, with the correct answer indicated. The content is structured into chapters, focusing on fundamental concepts of web development.
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)
7 views

Question for web programing

The document contains a series of questions and answers related to HTML and CSS, covering topics such as HTML tags, attributes, and CSS properties. Each question includes multiple-choice options, with the correct answer indicated. The content is structured into chapters, focusing on fundamental concepts of web development.
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/ 19

Chapter (1)

1. What does HTML stand for?


A. Hyper Trainer Marking Language
B. Hyper Text Markup Language
C. High Text Markup Language
D. Hyperlinking and Text Marking Language
✅ Correct answer: B

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

3. What tag is used to define a paragraph in HTML?


A. <p>
B. <par>
C. <text>
D. <pg>
✅ Correct answer: A

4. Which tag is used to define the largest heading?


A. <heading>
B. <h6>
C. <h1>
D. <head>
✅ Correct answer: C

5. What does the <br> tag do?


A. Adds a border
B. Breaks a page
C. Creates a line break
D. Inserts a paragraph
✅ Correct answer: C

6. The HTML tag <hr> is used to:


A. Add a heading rule
B. Insert a horizontal line
C. Highlight text
D. Add a hyperlink
✅ Correct answer: B

7. Which of the following is an empty HTML tag?


A. <p>
B. <br>
C. <body>
D. <h1>
✅ Correct answer: B

8. What does the <title> tag do?


A. Adds a title in the document body
B. Defines the title of the web page in the browser tab
C. Makes text bold
D. Displays a tooltip
✅ Correct answer: B

9. What is the correct syntax for the HTML5 doctype declaration?


A. <!DOCTYPE HTML5>
B. <!DOCTYPE html>
C. <DOCTYPE html>
D. <!DOCTYPE>
✅ Correct answer: B

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

12. To make text italic in HTML, use the tag:


A. <italic>
B. <em>
C. <it>
D. <i>
✅ Correct answer: D

13. Which element displays preformatted text in a fixed-width font?


A. <pre>
B. <format>
C. <code>
D. <text>
✅ Correct answer: A
14. The attribute used to apply inline CSS styles is:
A. font
B. css
C. style
D. design
✅ Correct answer: C

15. Which tag highlights or marks text in HTML?


A. <highlight>
B. <mark>
C. <hl>
D. <strong>
✅ Correct answer: B

16. What tag defines deleted text with a strikethrough?


A. <del>
B. <strike>
C. <delete>
D. <rm>
✅ Correct answer: A

17. What is the correct tag for superscript text?


A. <up>
B. <super>
C. <sup>
D. <sub>
✅ Correct answer: C

18. To set the text color to red, which style is correct?


A. style="color:red;"
B. font="color:red;"
C. style="text:red;"
D. color="red"
✅ Correct answer: A

19. Which HTML tag is used to define inserted text?


A. <add>
B. <insert>
C. <ins>
D. <include>
✅ Correct answer: C

20. What tag defines a subscript, like H₂O?


A. <small>
B. <low>
C. <sub>
D. <under>
✅ Correct answer: C
21. Which HTML element is used to specify a title for the document?
A. <meta>
B. <title>
C. <head>
D. <body>
✅ 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

24. What is the correct tag for defining emphasized text?


A. <italic>
B. <em>
C. <i>
D. <strong>
✅ Correct answer: B

25. Which section contains metadata about the HTML document?


A. <body>
B. <header>
C. <head>
D. <meta>
✅ Correct answer: C

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

29. Which tag is used to underline newly added text in a document?


A. <ul>
B. <ins>
C. <u>
D. <add>
✅ Correct answer: B

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

31. Which of the following defines superscript text?


A. <high>
B. <upper>
C. <sup>
D. <sub>
✅ Correct answer: C

32. Which HTML tag starts an HTML document?


A. <start>
B. <body>
C. <begin>
D. <html>
✅ Correct answer: D

33. What tag is used to define inserted (new) text in a document?


A. <ins>
B. <insert>
C. <new>
D. <add>
✅ Correct answer: A

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

35. What is the main role of the <head> tag in HTML?


A. Display visible content
B. Set body properties
C. Contain meta and title information
D. Add CSS directly
✅ Correct answer: C
36. What HTML tag makes text bold without adding meaning or importance?
A. <strong>
B. <bold>
C. <b>
D. <important>
✅ Correct answer: C

37. Which is true about the <pre> tag?


A. It removes white spaces and line breaks
B. It renders content in italics
C. It preserves formatting and spacing
D. It only works inside tables
✅ Correct answer: C

38. What tag is used to create a line break in text?


A. <lb>
B. <break>
C. <br>
D. <newline>
✅ Correct answer: C

39. Which of the following correctly centers a heading?


A. <h1 align="center">
B. <h1 style="text-align:center;">
C. <center><h1></h1></center>
D. Both B and C
✅ Correct answer: D

40. Which tag defines subscripted text in HTML?


A. <lower>
B. <sub>
C. <small>
D. <subtext>
✅ Correct answer: B
41. When saving an HTML file using Notepad, which encoding should you
select?
A. ANSI
B. ASCII
C. UTF-8
D. Unicode
✅ Correct answer: C

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

45. What is the primary difference between <i> and <em>?


A. <i> is obsolete and not rendered.
B. <em> adds semantic meaning (emphasis), while <i> is purely visual.
C. <em> is for small text; <i> is for italics.
D. Both tags are exactly the same.
✅ Correct answer: B

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

2. Which of the following sets the background color of a paragraph to "Tomato"?


A. <p style="text-color:Tomato;">Text</p>
B. <p background="Tomato">Text</p>
C. <p style="background-color:Tomato;">Text</p>
D. <p style="color:Tomato;">Text</p>
Correct Answer: C

3. What does RGB stand for in HTML color values?


A. Red, Gray, Black
B. Red, Green, Blue
C. Random, Generated, Background
D. Right, Great, Bold
Correct Answer: B

4. How many standard color names are supported in HTML?


A. 64
B. 128
C. 140
D. 256
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

6. What is the HEX value for pure red?


A. #00ff00
B. #0000ff
C. #ff0000
D. #ffffff
Correct Answer: C

7. What does HSL stand for?


A. Hue, Shade, Luminance
B. High Saturation Light
C. Hue, Saturation, Lightness
D. Highlight Saturation Level
Correct Answer: C

8. Which is NOT a correct way to apply CSS to an HTML document?


A. Inline CSS
B. Internal CSS
C. Java CSS
D. External CSS
Correct Answer: C

9. Where is an internal CSS defined in an HTML page?


A. In the <body> section
B. Inside a <div>
C. Inside the <head> using <style>
D. In a .css file
Correct Answer: C

10. Which CSS property is used to change the text size?


A. font-type
B. text-size
C. font-size
D. text-style
Correct Answer: C

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

14. What is the extension for an external CSS file?


A. .html
B. .css
C. .js
D. .style
Correct Answer: B

15. What will this code do?


html
<h1 style="color:blue;">Hello</h1>
A. It will make the heading bold
B. It will make the heading color blue
C. It will make the background blue
D. It will do nothing
Correct Answer: B

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

17. In HSL, what hue value represents the color blue?


A. 0
B. 120
C. 180
D. 240
Correct Answer: D

18. Which color model uses hexadecimal values?


A. HSL
B. RGB
C. HEX
D. CMYK
Correct Answer: C

19. What does the “Saturation” value in HSL control?


A. The brightness
B. The opacity
C. The vividness or intensity of color
D. The transparency level
Correct Answer: C

20. What HTML tag is used to link an external CSS file?


A. <style src="styles.css">
B. <link rel="stylesheet" href="styles.css">
C. <script src="styles.css">
D. <css href="styles.css">
Correct Answer: B

21. What type of CSS is this?


<p style="color:green;">Hello</p>
A. External
B. Internal
C. Inline
D. Global
Correct Answer: C

22. What’s the correct order of the RGB model?


A. Red, Blue, Green
B. Blue, Red, Green
C. Green, Red, Blue
D. Red, Green, Blue
Correct Answer: D

23. In which section of an HTML page should an internal CSS be placed?


A. After <body>
B. Inside <footer>
C. Inside <head>
D. At the end of the document
Correct Answer: C

24. Which CSS property defines the outermost spacing around an element?
A. padding
B. border
C. outline
D. margin
Correct Answer: D

25. Which of the following defines a gray color in RGB?


A. rgb(100, 100, 100)
B. rgb(0, 0, 255)
C. rgb(255, 255, 0)
D. rgb(255, 0, 255)
Correct Answer: A

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

27. What does this HEX color represent: #000000?


A. White
B. Transparent
C. Black
D. Red
Correct Answer: C

28. Which CSS property defines the border thickness and color?
A. border-style
B. border-width
C. border
D. outline
Correct Answer: C

29. What does the font-family property in CSS control?


A. Font size
B. Font color
C. Font spacing
D. Font typeface
Correct Answer: D

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy