Other dimensions and URL values
Definition and purpose
CSS also uses angles, times, resolution, flex fractions and frequencies. These types describe different quantities. A URL value identifies a resource, for example a background image, rather than a numeric dimension.
Angle and time units
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style>#a { rotate: .25turn; transition-duration: 250ms; }</style> </head> <body> <div id="a">Marker</div> </body></html>The angle resolves to a quarter turn, and 250 milliseconds equals a quarter second. The example does not trigger a transition.
Syntax and mental model
A full turn equals 360deg; 1s equals 1000ms; 1dppx equals 96dpi. Grid track fractions such as 1fr allocate flexible space, not a length valid in width. Frequency values use Hz or kHz; they are not widely used in modern visual CSS. url("image.svg") refers to a resource, with relative paths in external CSS based on the stylesheet URL. The examples use a local data URL so no network is required. Grid, transforms and animation are introduced later; here observe their value types.
Grid fractions and a resource
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> .grid { display: grid; width: 240px; grid-template-columns: 1fr 2fr; } #a { background-image: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27/%3E"); } </style> </head> <body> <div class="grid"> <div id="a">One</div> <div id="b">Two</div> </div> </body></html>In this simple grid, available space divides into one and two shares. The URL supplies a decorative empty SVG resource; no image load is asserted.
Common mistakes
Do not put 1fr into width or confuse 250ms with 250s. A CSS background is decorative; use semantic HTML with alternative text for meaningful images. External URLs can fail or introduce network and privacy dependencies.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Math for flexible sizes. Next lesson: Named, hex and RGB colors.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Other dimensions and URL values — knowledge check
Five questions on other dimensions and url values.
How many degrees are .5turn?
What is 250ms in seconds?
Which property context accepts fr?
What is 1dppx equivalent to?
What determines a relative URL in an external stylesheet?