Website Design Foundation Website Design 2 — Questions and Answers
Question 1: Which CSS property controls the space between the content and the border of an element?
- margin
- padding (Correct answer)
- spacing
- gap
Correct answer: padding
Padding controls the space between an element's content and its border, while margin controls space outside the border.
Question 2: What does the HTML `<meta charset='UTF-8'>` tag do?
- Sets the page title
- Defines character encoding (Correct answer)
- Links a stylesheet
- Sets the viewport
Correct answer: Defines character encoding
The charset meta tag specifies the character encoding for the HTML document, with UTF-8 supporting most characters worldwide.
Question 3: Which image format is best suited for photographs on a website?
- PNG
- SVG
- JPEG (Correct answer)
- GIF
Correct answer: JPEG
JPEG uses lossy compression that efficiently reduces file size for photographs without noticeable quality loss.
Question 4: What is the purpose of a wireframe in web design?
- To add final colors and branding
- To write the HTML code structure
- To create a low-fidelity layout blueprint (Correct answer)
- To test website performance
Correct answer: To create a low-fidelity layout blueprint
A wireframe is a low-fidelity visual blueprint that maps out page layout and structure before detailed design begins.
Question 5: Which CSS unit is relative to the root element's font size?
- em
- rem (Correct answer)
- px
- vh
Correct answer: rem
rem (root em) is always relative to the font size set on the root `<html>` element, making it more predictable than em.
Question 6: What is the default display value of a `<div>` element?
- inline
- inline-block
- block (Correct answer)
- flex
Correct answer: block
By default, `<div>` is a block-level element, meaning it starts on a new line and takes up the full available width.
Question 7: Which principle of design refers to the visual weight and distribution of elements on a page?
- Contrast
- Balance (Correct answer)
- Proximity
- Repetition
Correct answer: Balance
Balance refers to the visual equilibrium created by distributing elements and their visual weight across a composition.
Which CSS property controls the space between the content and the border of an element?