Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CSS measurement units Cheat Sheet

Absolute Length Units

  1. pc = pica (~16px)
  2. mm = millimeter  ( ~3.78px)
  3. cm = centimeter  (~37.79px)
  4. px = Pixel
  5. pt = pont  (~1.333px)

EXAMPLE:

width:10pc / 10cm / 20mm / 100px;

Relative Length Units

  1. ex = size of ‘x'(word ‘x’) in current Font.
  2. em = size of default font family text (default size of em is 16px  and it changes with parent font size)
  3. rem = root em (represnt size of root element  font size (16px) )

EXAMPLE:

width : 88ex / 22em / 2rem;

Viewport relative units

  1. vw = viewport width ( 1% of size of viewport)
  2. vh = viewport height ( 1% size of viewport)
  3. vmin = viewport minimum ( 1% of the smallest side)
  4. vmax = viewport maximum ( 1% of the largest side)

EXAMPLE:

  1. width: 50vw / 50vh / 50vmin / 44vmax;

The post CSS measurement Units Cheat Sheet appeared first on Ishu Sharma Blog.



This post first appeared on Ishu Sharma, please read the originial post: here

Share the post

CSS measurement units Cheat Sheet

×

Subscribe to Ishu Sharma

Get updates delivered right to your inbox!

Thank you for your subscription

×