[英]Should root element font size affect elements other than text?
Learning about rem
and try to make whole website responsive.学习
rem
并尝试使整个网站响应。
According to the value of 1rem
, should I be scaling:根据
1rem
的值,我应该缩放:
Does this depend on the layout?这取决于布局吗?
For example, I have an image in a card component.例如,我在卡片组件中有一个图像。 As user increases the font size, image or space around it might stay small next to a larger font.
当用户增加字体大小时,它周围的图像或空间可能会在较大字体旁边保持较小。
Should I let this happen or scale image with the font size?我应该让这种情况发生还是使用字体大小缩放图像? I know the setting in the browser only changes font size.
我知道浏览器中的设置只会改变字体大小。 On Facebook, for instance, font size from browser settings does not affect the images or component sizes.
例如,在 Facebook 上,浏览器设置中的字体大小不会影响图像或组件大小。
Should I then only worry about text?那么我应该只担心文本吗?
I think this is entirely based on context/preference but,我认为这完全基于上下文/偏好,但是,
Generally yes, if you are using 'em' for padding/margin (which you should be) this will scale automatically however to the font-size of its element.通常是的,如果您使用 'em' 进行填充/边距(您应该这样做),这将自动缩放到其元素的字体大小。
Depends on the element, text is hard to read for some people as its small lines in unique shapes so this makes the most sense to scale however images and other elements are generally a lot easier to look at.取决于元素,文本对于某些人来说很难阅读,因为它的小线条具有独特的形状,因此缩放最有意义,但图像和其他元素通常更容易查看。 - if the content of the element is something like an icon for button I would probably scale it with text as it is likely to be adjacent to some text so would look weird if the text scaled but the element didn't.
- 如果元素的内容类似于按钮的图标,我可能会用文本缩放它,因为它可能与某些文本相邻,所以如果文本缩放但元素没有缩放,看起来会很奇怪。 Otherwise I would just use responsive web design such as flex/grid to fill the space of a page, this is "scaling" however less for accessibility and more for design.
否则我只会使用响应式网页设计,例如 flex/grid 来填充页面的空间,这是“缩放”,但对于可访问性而言较少,而对于设计则较多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.