CSS: What's Computed Style?

By Xah Lee. Date: . Last updated: .

A computed style, is all the style that applies to the element.

Why do you want to know computed style? For example, you want to know what color is used on a element, but the element itself usually doesn't have any CSS spec. Instead, it may inherit styles from the page's CSS or site-wide CSS file. So, to find out its color value, you need to know the computed style.

How to Find the Computed Style

One easy way to find the computed style is by browser's web dev tool.

Firefox web dev tool 2013-07-10
Firefox web dev tool.

Modern browsers have dev tools that are very useful. They are extremely powerful tools. They are also a command line console, debugger, basically a full IDE. It also lets you see the computed style of any element. Both Firefox and Google Chrome's web dev tool are fantastic. Try to play with them. They are usually under the menu Tools.

Like what you read? Buy JavaScript in Depth