Lightcoder
Lightcoder

Reputation: 263

Can we define height and width of an element using em units in css?

I have seen many times as highly skilled web designers/developers apply em unit in font-size as well as for margin and padding, I am curious to know that em unit could also be applied on the height and width of the element? OR we can stick with pixels on that.

Upvotes: 1

Views: 997

Answers (1)

oezi
oezi

Reputation: 51797

yes, you can use em (and pt, % and all the others) for width and height, too.

Upvotes: 3

Related Questions