From the course: CSS Positioning Best Practices

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Understanding units of measure in CSS

Understanding units of measure in CSS - CSS Tutorial

From the course: CSS Positioning Best Practices

Understanding units of measure in CSS

There are several different units of measure available in CSS and we are going to cover the most common of them here. First one I want to talk about is color, and so here we have a color specified. This # sign means that it's going to be a hexadecimal color and it's in three parts, Red, Green and Blue, RGB, and these are hexadecimal numbers. There are two ways to specify hexadecimal numbers. There is the three-digit way and there is the six-digit way. The six-digit way is probably more common. I tend to like to use the three-digit version. The six-digit version looks exactly like this and so the three-digit version is just the six-digit version with the numbers doubled. This is exactly the same color. If I reload the document, you will see no change, but if I wanted to, I could say 6f3005, and we would get a slightly different color, not much. And it's hard to see the difference, and so that's why frankly I tend to use the three-digit version. The six-digit version has more resolution…

Contents