CSS 流体布局
我正在使用CSS流体布局(基于自适应/响应式网页设计)设计一个网站,
所以我不会给出任何固定值,即以px为单位(仅使用%)
我的问题是;虽然我确实理解如果给容器宽度为 100%,它将根据浏览器窗口(或视口宽度)进行计算。但是,当我们说正文字体为 100% 或 1 em 时,字体大小又如何计算呢? 另外,桌面设备和移动设备上的可见字体大小是否相同?
I am designing a website using the CSS fluid layout (based on adaptive/responsive web design)
So I would not give anything as fixed value i.e. in px (only use %)
My question is ; While I do understand if I give the container a width of 100%, it would get calculated based on the browser window ( or viewport width) . But what about the font sizes like when we say 100% or 1 em for the body font, how will that be calculated ?
Also are the visible font-sizes going to be same on desktop as well as mobile devices ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相对字体大小单位是根据用户默认字体大小计算的,如果您想根据屏幕尺寸调整字体大小,则必须使用媒体查询。
在移动设备上,由于分辨率更高,文本显得更小,请小心!
Relative font-size units are calculated from user default font-size, you have to use media queries if you want to adjust font-size from screen dimensions.
On mobile device text appears smaller because resolution is greater, be careful!