CSS Default Units

前端 未结 6 2032
日久生厌
日久生厌 2020-12-06 11:25

Can I change the default unit from pixel to mm? For example I want when move an element left and top to be in mm not in pixel?

6条回答
  •  执笔经年
    2020-12-06 12:07

    Specifying CSS units is a requirement for non-zero values. Browsers may try to guess what you meant, but it would still be a broken stylesheet according to the standard.

    I.e. there is no "default unit" in CSS2, it's just that the browser may try to help you out, although it may as well just ignore your statement that doesn't specify units as an invalid one.

提交回复
热议问题