home file-empty pencil screen user heart reply share social loading

Keith J. Grant

Photo of Keith

Atlanta, GA
United States

CSS in Depth

I feel like a guy yelling, “don’t drive on the sidewalk because people should be able to walk there” and your response is “nobody walks on the sidewalk because everybody drives there.”

Anyway, the larger point is: driving on the road is better. And I would argue using relative units is better in many cases. Why? Because the code maintenance is easier. True, using px requires less thought up front. But if you use relative units, you can define systems that work together better as a whole.

You can change a few inputs and have the entire system respond. You can define things in terms of your fonts, because your fonts are an integral part of the design. With pixels, small changes in the future can require code changes all over your code to adapt to that change. With units, done right, one small change can update the entire system accordingly.


Loading interactions...