<dimension>
Quick Summary for <dimension>
The <dimension> CSS data type represents a <number> with a unit attached to it, for example 10px.
Code Usage for <dimension>
12px      12 pixels 1rem      1 rem 1.2pt     1.2 points 2200ms    2200 milliseconds 5s        5 seconds 200hz     200 Hertz 200Hz     200 Hertz (values are case insensitive) 
More Details for <dimension>

<dimension>

The <dimension> CSS data type represents a <number> with a unit attached to it, for example 10px.

CSS uses dimensions to specify distances (<length>), durations (<time>), frequencies (<frequency>), resolutions (<resolution>), and other quantities.

Syntax

The syntax of <dimension> is a <number> immediately followed by a unit which is an identifier. Unit identifiers are case insensitive.

Examples

Valid dimensions

12px      12 pixels 1rem      1 rem 1.2pt     1.2 points 2200ms    2200 milliseconds 5s        5 seconds 200hz     200 Hertz 200Hz     200 Hertz (values are case insensitive) 

Invalid dimensions

12 px       The unit must come immediately after the number. 12"px"      Units are identifiers and therefore unquoted. 3sec        The seconds unit is abbreviated "s" not "sec". 

Specifications

Specification
CSS Values and Units Module Level 5 # dimensions

See also

CSS data types Learn to style HTML using CSS CSS distances (<length>), durations (<time>), frequencies (<frequency>), and resolutions (<resolution>)

Last modified: Aug 12, 2021, by MDN contributors

Select your preferred language English (US)Français日本語中文 (简体) Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
If you work on something a little bit every day, you end up with something that is massive.
Kenneth Goldsmith
Random CSS Property

table-layout

The table-layout CSS property sets the algorithm used to lay out <table> cells, rows, and columns.
table-layout css reference