根据用户屏幕重新调整大小调整网页大小。 [英] resize the webpages according to user screen resulation.

查看:134
本文介绍了根据用户屏幕重新调整大小调整网页大小。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的问题是我制作了一个网站,它是屏幕分辨率1368 * 768的最佳视图。这个网站在这个分辨率上看起来非常好,但是当有人在另一台具有不同分辨率的PC上查看它时,所有网页都会改变,所有页面都会出现水平滚动。这是因为我使用了div而不是表和所有div相互重叠。



我想根据屏幕分辨率添加css文件。这样就解决了这个问题。无论是以1024 * 768还是1368 * 766或任何其他分辨率观看,网站的外观都会变得相似。这是用户屏幕分辨率独立的。



我认为可以用Javascript或JQuery完成。但是我不知道怎么回事。







请帮助我!



谢谢



Balwant



my problem is that i made a website which is best view in the screen resolution 1368*768. this website look's very good in this resolution but when someone view it in another PC having different resolution, then all web pages alter and horizontal scroll coming for all pages. this is due to that i have used div rather then table and all div's overlaping with each other.

i want to add css file's according to the screen resolution. so that this problem is resolved. and the look and feel of website become alike whether it is viewed in 1024*768 or 1368*766 or any other resolution. That is user screen resolution independent.

I think it could be done with Javascript or JQuery. but i don't know how to this.



Please help me!

Thanks

Balwant

推荐答案

你可以带使用CSS照顾这个。 Css包含以多种方式调整对象的功能,其中之一是百分比:

You can take care of this using CSS. Css contains functionality to 'size' objects in serveral ways, one of them is percentage :
#container { background: #0000FF; }

.fullWidth { width: 100%; }





和HTML文件中,你包括CSS文件并编写例如以下对象:



and in your HTML file, you include the CSS file and write for example the following object :

<div id="container" class="fillWith">
  Wow, this container uses 100% of my browser's available width!
</div>





参见这个 [ ^ ]示例获取更多信息!



玩得开心,



Eduard



See this[^] example for more information!

Have fun,

Eduard


没有办法确保你的网页在每个分辨率中看起来都一样!!!

有一种方法可以确保它看起来最佳,它叫做响应式网页设计 [ ^ ] ...
There is NO WAY to ensure that your web page will look the same in every resolution!!!
There is a way to ensure it looks optimal, it called responsive web design[^]...


您想要的是您网页的流畅布局。如果您在Google上搜索流畅布局CSS,您将获得许多链接,帮助您在网站中使用CSS实现它。



您可能还想阅读此内容 - 固定vs流体与弹性布局:什么是适合你的? [ ^ ]。这是一个很好的阅读,可以帮助你更好地设计你的布局。



希望这会有所帮助! :thumbsup:



干杯!

Ankur
What you want here is a fluid layout for your web page. If you search Google for "fluid layout CSS" you will get many links that helps you implement it using CSS in your web site.

You may also like to read this - Fixed vs. Fluid vs. Elastic Layout: What's The Right One For You?[^]. It's a good read and would help you design your layout better.

Hope this helps! :thumbsup:

Cheers!
Ankur


这篇关于根据用户屏幕重新调整大小调整网页大小。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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