From the course: CSS: Float-Based Page Layouts (2012)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Calculating percentage values

Calculating percentage values - CSS Tutorial

From the course: CSS: Float-Based Page Layouts (2012)

Start my 1-month free trial

Calculating percentage values

Even though percentage values are always defined as being relative to another value, they're still defined separately in the CSS specification, meaning they are not grouped with other relative units of measurement; they are just sort of defined by themselves. Now one of the reasons for this is that percentages have their own very unique rules when it comes to how their values are calculated. To use percentage values in your layout with confidence, you're going to need to understand exactly how their values are computed. So if you are going to do this along with me, go ahead and open up percentages.htm, which can be found in 01_05 directory. This is exactly the same file that we used in our last movie, so if did the calculating em values with this--let me just go ahead and just preview this--you can see it's pretty the same file. Same structure, same everything. Now I am going to jump back into my code here, and let's talk about this for a moment. If I scroll down into my body, you can…

Contents