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 em values

Calculating em values - CSS Tutorial

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

Start my 1-month free trial

Calculating em values

Figuring out the value that you need for an element's width, height, or other physical properties is pretty simple if you use pixels. However, what if you are going to use a relative unit of measurement, like an em, or even percentages? Well, in those instances it can sometimes be tricky to accurately calculate the computed value of the element's properties. Now understanding how this works is critical to creating certain types of layouts, so it's really important for us to take a closer look at it. Now, if you remember, an em is a relative unit of measurement that is equal, 1 em is say equal to the default font size of an element. Now if you need to review what an em is or any of the different units of measurement that are available to us in CSS, be sure to go back to the CSS: Core Concepts title and review the movie on units of measurement where I talk about them in a little bit more detail. Okay, so for this example we are going to be using the em_values.htm file. You can find that…

Contents