From the course: CSS: Float-Based Page Layouts (2012)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Calculating percentage values - CSS Tutorial
From the course: CSS: Float-Based Page Layouts (2012)
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Box model review8m 47s
-
(Locked)
Calculating element dimensions11m 11s
-
Understanding margin collapse7m 59s
-
(Locked)
Calculating em values7m 41s
-
(Locked)
Calculating percentage values7m 51s
-
(Locked)
Normal document flow13m 3s
-
(Locked)
Controlling element display8m 53s
-
(Locked)
Using CSS Resets7m 11s
-
(Locked)
Fixed, fluid, and responsive layouts9m 9s
-
(Locked)
CSS debugging tools6m 46s
-
(Locked)
Using the Firebug Inspector and the WebKit Web Inspector11m 5s
-
(Locked)
-
-
-
-
-
-
-
-