Conversion Table
Centimeters | Viewport Width |
---|---|
0.1cm | 0.168vw |
0.5cm | 0.839vw |
1cm | 1.678vw |
2cm | 3.356vw |
3cm | 5.033vw |
4cm | 6.711vw |
5cm | 8.389vw |
6cm | 10.067vw |
7cm | 11.744vw |
8cm | 13.422vw |
9cm | 15.100vw |
10cm | 16.778vw |
15cm | 25.167vw |
20cm | 33.556vw |
25cm | 41.944vw |
30cm | 50.333vw |
35cm | 58.722vw |
40cm | 67.111vw |
Differences Between cm and vw
Centimeters (cm) are a metric unit of length commonly used in physical measurements. Viewport Width (vw) is a relative unit based on 1% of the viewport width in digital displays.
Advantages of Using cm
Using centimeters provides a physical measurement that can be easily converted to digital units like vw for web design and other digital applications.
How to Convert cm to vw
To convert centimeters to vw, use the following formula:
vw = cm * (96 / 2.54 / viewport width)
For example, to convert 2cm to vw with a viewport width of 1920px:
2cm * (96 / 2.54 / 1920) = 3.356vw
Frequently Asked Questions
Why should I use cm instead of vw?
Centimeters provide a physical measurement that is easy to understand and use in real-world applications. vw units are more suitable for digital displays and web design.
How do I set sizes using cm in CSS?
In CSS, you can set sizes using the cm unit, for example:
width: 10cm;
Can I mix cm and vw units?
It's possible but not recommended. Stick to one unit for consistency in your designs.