如何使网站适应用户的屏幕分辨率? [英] How to adapt website to user's Screen Resolution?

查看:197
本文介绍了如何使网站适应用户的屏幕分辨率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用1024x768屏幕分辨率的基础设计我的网站。当您在浏览器中使用更小/更大屏幕分辨率的计算机查看网站时,网站开始变形。

如何使网站适应用户的屏幕分辨率,无论什么屏幕分辨率用户有?我相信可能是通过JavaScript或CSS,但不知道如何...

I'm designing my website by using a base of 1024x768 screen resolution. When you're looking at the website in the browser from a computer with a smaller/bigger screen resolution the website starts to deform.
How can I adapt the website to user's screen resolution no matter what screen resolution the user have? I believe it's possible trough JavaScript or CSS, but not sure how...

推荐答案

解决这个问题的最好方法是使用 使用 em 或%(百分比)。

The best way to tackle this issue is instead of using px use em or % ( percentage ).

.container {
  width: 1000 px;
  height: 750 px;
}







.container {
  width: 90%;
  height: 90%'
}

这篇关于如何使网站适应用户的屏幕分辨率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆