CSS默认单位 [英] CSS Default Units

查看:84
本文介绍了CSS默认单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以将默认单位从pixel更改为mm吗?
例如,我想要移动一个元素左边和顶部以mm而不是像素?

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?

推荐答案

指定CSS单位是非零值的要求。浏览器可能会尝试猜测你的意思,但它仍然是一个破碎的样式表根据标准。

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.

在CSS2中没有默认单位,只是浏览器可能会尝试帮助你,虽然它可能会忽略你的语句,没有指定单位作为一个无效的。

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.

这篇关于CSS默认单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆