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

既然已经设置为理想视口,setBodyFontSize里为什么还要根据dpr设置字体大小 #201

Open
nieyt opened this issue Apr 7, 2020 · 15 comments

Comments

@nieyt
Copy link

nieyt commented Apr 7, 2020

不应该是统一设置为一样的font-size吗

@jczzq
Copy link

jczzq commented Oct 25, 2020

setBodyFontSize 应该是多余的

@RopeHuo
Copy link

RopeHuo commented Dec 10, 2020

同问,
1、不太明白设置body的字体是为了处理什么,
2、最后为了处理border的逻辑又是什么意思

@RopeHuo
Copy link

RopeHuo commented Dec 10, 2020

同问,
1、不太明白设置body的字体是为了处理什么,
2、最后为了处理border的逻辑又是什么意思

1、初步认为,设置body字体大小是为了在dpr不同的情况下使默认文字大小相应变化

@youzizi1
Copy link

youzizi1 commented Mar 23, 2021

@RopeHuo

  1. body设置的font-size单纯作为阅读字体大小,html设置的font-size仅仅用来布局
  2. 最后处理border是用来检测浏览器是否支持0.5px,因为有些浏览器是能直接处理0.5px边框,不需要再使用hack手法

仅仅个人理解。

@xiaojieajie
Copy link

我也想问这个问题

@chaozhang5
Copy link

body上设置12 * dpr的font-size值,为了重置页面中的字体默认值,不然没有设置font-size的元素会继承html上的font-size,变得很大

@maczyt
Copy link

maczyt commented Sep 3, 2022 via email

@qhq747
Copy link

qhq747 commented Sep 3, 2022 via email

@yanlin-accp
Copy link

yanlin-accp commented Sep 3, 2022 via email

@xu-Aurora
Copy link

我也想问这问题,因为当dpr为2的情况下,设置的默认body字体就是24px,此时rem的设置的值所有的都变大了。感觉不设置这个dpr才是对的

@yanlin-accp
Copy link

yanlin-accp commented Dec 12, 2023 via email

@qhq747
Copy link

qhq747 commented Dec 12, 2023 via email

@XurryAli
Copy link

XurryAli commented Dec 12, 2023 via email

@JavonLuo
Copy link

body上设置12 * dpr的font-size值,为了重置页面中的字体默认值,不然没有设置font-size的元素会继承html上的font-size,变得很大

直接用12 * dpr 感觉也不对呀。比如在相同屏幕的尺寸下,iphone3G和iphone4屏幕都是一样大尺寸,但是iphone4下的font-size:24px,iphone3g是12px,不就显示大小不一致了么?

@yanlin-accp
Copy link

yanlin-accp commented Mar 25, 2024 via email

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