CIW Web Foundations Associate 4 — Questions and Answers
Question 1: What is the primary function of JavaScript in web development?
- To define the structure and content of web pages
- To style the visual appearance of web pages
- To add interactivity and dynamic behavior to web pages (Correct answer)
- To manage server-side database queries
Correct answer: To add interactivity and dynamic behavior to web pages
JavaScript is a scripting language that enables dynamic, interactive behavior on web pages in the client's browser.
Question 2: Which CSS box model property creates space outside an element's border, separating it from other elements?
- padding
- margin (Correct answer)
- outline
- border-spacing
Correct answer: margin
Margin is the space outside an element's border that separates it from neighboring elements.
Question 3: In networking, what does 'IP' stand for?
- Internet Process
- Internal Protocol
- Internet Protocol (Correct answer)
- Integrated Path
Correct answer: Internet Protocol
IP stands for Internet Protocol, the set of rules governing how data packets are sent and received across networks.
Question 4: Which HTML element is used to embed a video file directly into a web page?
- <media>
- <embed>
- <video> (Correct answer)
- <stream>
Correct answer: <video>
The HTML5 <video> element allows embedding video content directly in a web page without third-party plugins.
Question 5: What is the purpose of the DOCTYPE declaration at the top of an HTML document?
- It sets the character encoding for the page
- It tells the browser which version of HTML is being used (Correct answer)
- It links the HTML file to its CSS stylesheet
- It defines the page's metadata for search engines
Correct answer: It tells the browser which version of HTML is being used
The DOCTYPE declaration instructs the browser about the HTML version and standard to use when rendering the document.
Question 6: Which of the following best describes a 'cookie' in web technology?
- A type of malware that infects web servers
- A small data file stored on the user's computer by a website (Correct answer)
- A compressed file format for transferring web assets
- A server-side script that processes form data
Correct answer: A small data file stored on the user's computer by a website
A cookie is a small text file stored by the browser on the user's device to remember information between sessions.
Question 7: What is the function of the HTML <head> element?
- It displays the main navigation menu at the top of the page
- It contains metadata and links to resources not rendered directly on the page (Correct answer)
- It defines the header banner visible to site visitors
- It wraps the primary visible content of the web page
Correct answer: It contains metadata and links to resources not rendered directly on the page
The <head> element contains metadata such as the page title, character set, CSS links, and scripts that are not directly rendered in the page body.
What is the primary function of JavaScript in web development?