From the course: Practical CSS for No-Coders

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Understanding and applying size in CSS

Understanding and applying size in CSS

From the course: Practical CSS for No-Coders

Understanding and applying size in CSS

- [Instructor] To this point, the size of our text has come from the web browser's default style sheet. There's nothing wrong with these sizes, but on occasion you might want to change them or apply them to different chunks of text. Web sizing takes two forms, absolute and relative. Absolute sizes include points, which are used in print, or pixels. These sizes don't change with the screen size. Relative units like percents, or R-E-M, pronounced rem, may change with the size of the page. As I zoom in, these font sizes scale relative to the rest of the page. For this reason, relative units are preferred in web work. In general, professional web developers tend to use rem as their font size. To make a long story short, one rem usually equals 16 pixels. If I specify 1.5 rem as my font size, you can multiply that number to get its size in pixels, which winds up being about 24 pixels. Or you can go the other way, 0.8 rem…

Contents