CSS百分比宽度和高度和分辨率问题 [英] CSS percentage widths and heights and resolution problems
问题描述
我需要我的应用程序运行在多个屏幕分辨率。
目前我已经以百分比(%)而不是像素(px)指定所有尺寸,以便它将自动调整屏幕大小。
I need my application run in multiple screen resolutions. Currently I have specified all the dimensions in percentage (%) instead of pixels (px) so that it will automatically re-size with the screen.
将是更可靠的度量单位,用于指定我的网页上的尺寸:像素(或EM)或百分比
Which would be the more reliable unit of measurement for specifying dimensions on my webpage: Pixels (or EM) or Percentage
推荐答案
href =http://webdesignerwall.com/tutorials/responsive-design-with-css3-media-queries =nofollow> Responsive Webdesign 你真的应该利用媒体查询
For Responsive Webdesign you really should be leveraging media queries
我个人喜欢像素,因为他们给我更多控制,我可以可靠地知道每个元素的确切尺寸。使用媒体查询,您还可以根据屏幕分辨率设置新的样式。
Personally I prefer pixels because they give me more control, and I can reliably know the exact dimensions of each element. With media queries you can also set new styles based on the screen resolution.
百分比给你一个很好的反应灵敏度,但可以更加困难,以确保你的布局不是由每个级别的分辨率。
Percentages give you a nice responsive feel, but can be much more difficult to ensure you're layout is not junked by each level of resolution.
这篇关于CSS百分比宽度和高度和分辨率问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!