Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

px转rem的单位比例,默认为40 #31

Open
fish0205 opened this issue Jul 13, 2018 · 2 comments
Open

px转rem的单位比例,默认为40 #31

fish0205 opened this issue Jul 13, 2018 · 2 comments

Comments

@fish0205
Copy link

麻烦问一下:
转换的比例值是怎么计算的呢?
默认是40的意思是750px下比例为40吗?
万分感谢

@ming2xiao
Copy link

ming2xiao commented Jul 15, 2018

rem的转换是根据html标签设置的font-size大小进行转换的,如果你html的font-size设置的是20,那就是说1rem 就等于20px,750px的设计稿为iphone6的设计稿,在浏览器调试的时候你会发现宽度为375px,刚好是设计稿的一半,所以如果html的font-size设置的是20px,那么你用750的设计稿量出来的尺寸除以40就是你需要的rem单位。

@fish0205
Copy link
Author

万分感谢,非常详细,明白了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants