[WGU C777 EXAM] – QUESTIONS AND ANSWERS |
VERIFIED AND WELL DETAILED ANSWERS | PLUS
RATIONALES | GUARANTEED PASS | LATEST EXAM
UPDATE | STUVIA VERIFIED | EXAM PREP | STUDY
GUIDE | PRACTICE TEST
1. Which HTML5 element is specifically intended to contain introductory content or
navigational aids for a section?
A. <footer>
B. <header>
C. <aside>
D. <main>
Correct Answer: B. <header>
Rationale:
The <header> element is designed to contain introductory content, logos, headings, or
navigational aids for a page or section. It improves semantic structure and accessibility.
2. Which CSS property is primarily used to control the spacing inside an element’s border?
A. Margin
B. Border-spacing
C. Padding
D. Text-indent
Correct Answer: C. Padding
Rationale:
Padding controls the internal spacing between the content and the border of an element, while
margin controls spacing outside the element.
3. Which JavaScript keyword declares a block-scoped variable?
A. var
B. const
C. global
D. static
Correct Answer: B. const
,Rationale:
The const keyword creates a block-scoped variable whose value cannot be reassigned after
initialization.
4. Which HTML attribute improves accessibility by providing alternative text for images?
A. title
B. aria-label
C. alt
D. src
Correct Answer: C. alt
Rationale:
The alt attribute provides descriptive alternative text for images, allowing screen readers to
convey image meaning to visually impaired users.
5. Which CSS layout method is best suited for creating a one-dimensional layout?
A. Grid
B. Float
C. Position
D. Flexbox
Correct Answer: D. Flexbox
Rationale:
Flexbox is optimized for one-dimensional layouts, either in rows or columns, making alignment
and spacing easier.
6. What is the primary purpose of the <!DOCTYPE html> declaration?
A. Enable JavaScript
B. Define metadata
C. Tell the browser to use HTML5 standards
D. Link external CSS
Correct Answer: C. Tell the browser to use HTML5 standards
Rationale:
The <!DOCTYPE html> declaration instructs browsers to render the page using HTML5 standards
mode.
7. Which HTTP status code indicates that a requested page was not found?
A. 301
B. 404
, C. 500
D. 200
Correct Answer: B. 404
Rationale:
The 404 status code indicates that the requested resource could not be located on the server.
8. Which CSS property changes text color?
A. font-color
B. background-color
C. text-style
D. color
Correct Answer: D. color
Rationale:
The color property defines the foreground color of text within an element.
9. Which JavaScript method is used to select an element by its ID?
A. getElementById()
B. querySelectorAll()
C. getElementsByClass()
D. selectNode()
Correct Answer: A. getElementById()
Rationale:
The getElementById() method retrieves a single element matching the specified ID value.
10. Which HTML element represents the main content of a webpage?
A. <article>
B. <section>
C. <main>
D. <nav>
Correct Answer: C. <main>
Rationale:
The <main> element identifies the dominant content area of a webpage and improves semantic
clarity.
11. Which CSS unit is relative to the root font size?
A. px
, B. em
C. rem
D. vh
Correct Answer: C. rem
Rationale:
The rem unit is based on the root element’s font size, making responsive typography easier to
maintain.
12. Which JavaScript operator checks both value and data type equality?
A. ==
B. =
C. !=
D. ===
Correct Answer: D. ===
Rationale:
The === operator compares both value and data type without type conversion.
13. Which HTML form element allows users to select one option from multiple choices?
A. Checkbox
B. Textarea
C. Radio button
D. Submit button
Correct Answer: C. Radio button
Rationale:
Radio buttons allow users to select only one option within a related group.
14. Which CSS property controls the stacking order of positioned elements?
A. overflow
B. z-index
C. opacity
D. visibility
Correct Answer: B. z-index
Rationale:
The z-index property determines the stacking order of positioned elements along the z-axis.
VERIFIED AND WELL DETAILED ANSWERS | PLUS
RATIONALES | GUARANTEED PASS | LATEST EXAM
UPDATE | STUVIA VERIFIED | EXAM PREP | STUDY
GUIDE | PRACTICE TEST
1. Which HTML5 element is specifically intended to contain introductory content or
navigational aids for a section?
A. <footer>
B. <header>
C. <aside>
D. <main>
Correct Answer: B. <header>
Rationale:
The <header> element is designed to contain introductory content, logos, headings, or
navigational aids for a page or section. It improves semantic structure and accessibility.
2. Which CSS property is primarily used to control the spacing inside an element’s border?
A. Margin
B. Border-spacing
C. Padding
D. Text-indent
Correct Answer: C. Padding
Rationale:
Padding controls the internal spacing between the content and the border of an element, while
margin controls spacing outside the element.
3. Which JavaScript keyword declares a block-scoped variable?
A. var
B. const
C. global
D. static
Correct Answer: B. const
,Rationale:
The const keyword creates a block-scoped variable whose value cannot be reassigned after
initialization.
4. Which HTML attribute improves accessibility by providing alternative text for images?
A. title
B. aria-label
C. alt
D. src
Correct Answer: C. alt
Rationale:
The alt attribute provides descriptive alternative text for images, allowing screen readers to
convey image meaning to visually impaired users.
5. Which CSS layout method is best suited for creating a one-dimensional layout?
A. Grid
B. Float
C. Position
D. Flexbox
Correct Answer: D. Flexbox
Rationale:
Flexbox is optimized for one-dimensional layouts, either in rows or columns, making alignment
and spacing easier.
6. What is the primary purpose of the <!DOCTYPE html> declaration?
A. Enable JavaScript
B. Define metadata
C. Tell the browser to use HTML5 standards
D. Link external CSS
Correct Answer: C. Tell the browser to use HTML5 standards
Rationale:
The <!DOCTYPE html> declaration instructs browsers to render the page using HTML5 standards
mode.
7. Which HTTP status code indicates that a requested page was not found?
A. 301
B. 404
, C. 500
D. 200
Correct Answer: B. 404
Rationale:
The 404 status code indicates that the requested resource could not be located on the server.
8. Which CSS property changes text color?
A. font-color
B. background-color
C. text-style
D. color
Correct Answer: D. color
Rationale:
The color property defines the foreground color of text within an element.
9. Which JavaScript method is used to select an element by its ID?
A. getElementById()
B. querySelectorAll()
C. getElementsByClass()
D. selectNode()
Correct Answer: A. getElementById()
Rationale:
The getElementById() method retrieves a single element matching the specified ID value.
10. Which HTML element represents the main content of a webpage?
A. <article>
B. <section>
C. <main>
D. <nav>
Correct Answer: C. <main>
Rationale:
The <main> element identifies the dominant content area of a webpage and improves semantic
clarity.
11. Which CSS unit is relative to the root font size?
A. px
, B. em
C. rem
D. vh
Correct Answer: C. rem
Rationale:
The rem unit is based on the root element’s font size, making responsive typography easier to
maintain.
12. Which JavaScript operator checks both value and data type equality?
A. ==
B. =
C. !=
D. ===
Correct Answer: D. ===
Rationale:
The === operator compares both value and data type without type conversion.
13. Which HTML form element allows users to select one option from multiple choices?
A. Checkbox
B. Textarea
C. Radio button
D. Submit button
Correct Answer: C. Radio button
Rationale:
Radio buttons allow users to select only one option within a related group.
14. Which CSS property controls the stacking order of positioned elements?
A. overflow
B. z-index
C. opacity
D. visibility
Correct Answer: B. z-index
Rationale:
The z-index property determines the stacking order of positioned elements along the z-axis.