WEB-DEVELOPMENT-FOUNDATION practice question 13 of 15
What are the two types of CSS units? Choose 2 answers.
Full set: 75 questionsCSS length values are categorized into two types: absolute and relative. Absolute length units are fixed and are not affected by the size of the parent element or the viewport. They are most useful when the output medium's physical properties are known, such as for print layouts. Examples include pixels (px), points (pt), and centimeters (cm). Relative length units are specified in relation to another length property, making them flexible and scalable. Examples include em (relative to the font-size of the element), rem (relative to the root element's font-size), and % (relative to the parent element's size).
A. Static: 'Static' is the default value for the CSS position property, not a type of measurement unit.
D. Standard: This is not a formal classification for CSS units; both absolute and relative units are part of the CSS standard.
E. Local: This term is not used in the official CSS specification to categorize measurement units.
F. Metric: While some absolute units like cm and mm are metric, "Metric" is not a formal CSS unit category itself. ---
1. Mozilla Developer Network (MDN) Web Docs: The CSS data type page explicitly states, "There are two types of length units: absolute and relative." It then details the units within each category.
Source: MDN Web Docs, - CSS: Cascading Style Sheets. See the introductory paragraph in the "Values" section.
2. W3C (World Wide Web Consortium) CSS Values and Units Module Level 4: The official specification for CSS units defines these two categories in separate sections.
Source: W3C Candidate Recommendation, 29 September 2022, "CSS Values and Units Module Level 4," Sections 6.1 ("Relative Lengths") and 6.2 ("Absolute Lengths").
3. MIT OpenCourseWare: Course materials for web development and user interface design cover these fundamental CSS concepts.
Source: MIT OCW, "6.170 Software Studio," Fall 2012. Lecture 10 notes on CSS, section on "Units." (This course and similar ones like 6.813 consistently teach this fundamental absolute/relative distinction).
Keep practicing
Take the free WEB-DEVELOPMENT-FOUNDATION practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other WEB-DEVELOPMENT-FOUNDATION practice questions
- Question 2What is one of the possible values of the text-align property?
- Question 3What is matched by the :hover selector?
- Question 4What describes the matches resulting from the img: first-child selector?
- Question 5Which two color definitions are valid for use with CSS? Choose 2 answers.
- Question 8What does the timelines tool of Safari Web Inspector enable a developer to do?
- Question 9Developers consider three platforms for viewport sizes. What is one of them?
