<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 &lt;dimension&gt;
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 &lt;dimension&gt;

<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
 
Related Search Terms
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...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

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


Latest News
## 🚀 AI Giants Hit Bullseye: Anthropic & OpenAI Achieve Product-Market Fit Anthropic and OpenAI have reached a significant milestone, finding product-market fit with their AI technologies, which means their products effectively meet the needs of their customers, driving growth and adoption. This achievement showcases the practical value of their innovations, enabling businesses and individuals to leverage AI for enhanced productivity and efficiency. With this alignment of product and market needs, these companies are poised to transform industries and shape the future of technology.