问题描述
我的问题是我制作了一个网站,它是屏幕分辨率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
推荐答案
#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
这篇关于根据用户屏幕重新调整大小调整网页大小。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!