CIW CIW Web Design Specialist 1 — Questions and Answers
Question 1: Which CSS property controls the space between the content and the border of an element?
- margin
- padding (Correct answer)
- border-spacing
- outline
Correct answer: padding
The CSS `padding` property defines the space between an element's content and its border.
Question 2: What does the HTML `alt` attribute on an `<img>` tag primarily provide?
- Image title tooltip
- Alternative text for accessibility and SEO (Correct answer)
- Image file path
- Image dimensions
Correct answer: Alternative text for accessibility and SEO
The `alt` attribute supplies descriptive text used by screen readers and search engines when an image cannot be displayed.
Question 3: Which CSS display value causes an element to start on a new line and stretch the full available width?
- inline
- inline-block
- block (Correct answer)
- flex
Correct answer: block
A `block`-level element always starts on a new line and takes up the full width of its container.
Question 4: What is the purpose of CSS media queries in responsive web design?
- Load different JavaScript files
- Apply different styles based on device characteristics such as screen width (Correct answer)
- Embed audio/video files
- Query a database from CSS
Correct answer: Apply different styles based on device characteristics such as screen width
Media queries let designers apply CSS rules conditionally based on viewport size, orientation, or resolution.
Question 5: Which HTML5 semantic element is most appropriate for the main navigation links of a website?
- <aside>
- <footer>
- <nav> (Correct answer)
- <section>
Correct answer: <nav>
The `<nav>` element is the HTML5 semantic tag intended to contain the site's primary navigation links.
Question 6: In CSS, what does the `z-index` property control?
- Zoom level of an element
- Stacking order of overlapping positioned elements (Correct answer)
- Horizontal position on the z-axis
- Font size scaling
Correct answer: Stacking order of overlapping positioned elements
The `z-index` property determines which positioned element appears on top when elements overlap.
Which CSS property controls the space between the content and the border of an element?