Let's talk about CSS <length> data type.

It is used to specify distance measurements using absolute or relative units.

We can use them in CSS properties, such as width, height, margin, padding, font-size, and text-shadow.

⬇️
These CSS Units can be of mainly of two types :

👉 Absolute Lengths
👉 Relative Lengths

Let's see some of them below:

⬇️
1. Absolute Lengths (Do not change w.r.t device size ):

👉 cm/mm : Specify centimetres and millimetres.
👉 in : Specify inches.
👉 pc : Specify picas, 6 per inch.
👉 pt : Specify points, 72 per inch.
👉 px : Specify pixels, 96 per inch
2. (i) Relative Lengths (Changes w.r.t device size)

👉 em : relative to font size of the parent element
👉 rem: relative to font size of the root element
👉 ex : relative to x-height of element's font.
👉 ch : Based on width of the zero(0) character.
(ii) Relative viewport lengths.

👉 vw : Specify a percentage of the width of the current viewport
👉 vh : Specify a percentage of current viewport’s height.
👉 vmax and vmin : Specify the maximum or minimum of the viewport's width or height.
That's it for this thread. Did you find it useful? If yes, considering retweeting it and following me ( @SauravPurohit4 ) for more content on Web Development.

Thank You !!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Saurav Purohit

Saurav Purohit Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @SauravPurohit4

5 Jan
Are you a JavaScript developer or planning to be ?

Here are libraries that may come very handy to you.

👇🧵
👉 Three.js

JavaScript library to create amazing 3D interactive animations.

threejs.org
👉 Chart.js

Get simple, clean and engaging HTML5 based JavaScript charts.

🔗 chartjs.org
Read 11 tweets
4 Jan
Are you a web developer or planning to be one ?

Here are some awesome websites that may come very handy to you in your journey.

👇🧵
👉 roadmap .sh

Get roadmaps for almost every language you need.

roadmap.sh
👉 Devhints

Collection of cheat sheets that you may need.

devhints.io
Read 12 tweets
3 Jan
Are you a React Developer or planning to learn it ?

Here are some libraries you may across in your journey.

👇🧵
👉 react-router

Handles routing in React.

reactrouter.com
👉 styled-components

Let's you write css in JS files.

styled-components.com
Read 13 tweets
2 Jan
Learn programming the fun way.

👇🧵
👉 CodeinGame

CodinGame offers up fun free open-source programming games to help coders learn more than 25 programming languages.

codingame.com/start
👉 CSS Diner

CSS Diner is a simple but fun way to learn CSS for beginner coders. There are 32 levels that will teach you the basics of how CSS selectors work.

flukeout.github.io
Read 8 tweets
31 Dec 21
Are you planning to learn JavaScript in 2022 ?

Here are some resources you can follow.

👇🧵
👉 YouTube Channels

- Traversy Media
- The Net Ninja
- JavaScript Mastery
- Web Dev Simplified
- Clever Programmer
- Wes Bos
- Florin Pop
- Free Code Camp
- Dev Ed
- Akshay Saini
- Dcode
Read 7 tweets
30 Dec 21
Are you planning to make Front End projects in 2022 ?

Having a proper bank of resources can be be a huge asset.

👇🧵
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(