调整 WordPress 网站大小以适应计算机分辨率
我有一个宽度设置为 970 像素的 WordPress 网站,我在我的 Mac 上构建了它,分辨率设置为 1920 X 1080,但是当我的客户在他的计算机上查看它时,它会切断一些网站。下面是它在他的计算机上的外观以及我想要的外观的图片。我做了一些研究,发现了这段代码,但它似乎不起作用
我试图向他解释这是一个很难控制的变量,因为每台计算机都可以进行不同的设置。任何想法或建议都会很棒。
I have a wordpress site that is set to 970px wide and i built it on my mac that has a resolution set to 1920 X 1080 but when my client views it on his computer it cuts off some of the site. Below is a pic of what it looks like on his computer and what i want it to look like. I did some research and i found this code but it doesn't seem to work
<script language="javascript">
X = screen.width;
Y = screen.height;
window.moveTo(0,0);
window.resizeTo(X,Y)
</script>
I tried to explain to him that this is a variable that is hard to control since every computer could be set differently. Any Ideas or suggestions would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,这是一个关键的设计元素,通常在制作网站的第一阶段完成。固定宽度(如果是的话,需要什么尺寸)或流动(百分位)网站。
如果 WordPress 插件设置为像素,并且您尝试将其重新排列为 %,您将遇到无穷无尽的问题。
对你的问题的简短回答是,它不仅仅是在一行代码中插入那么简单,这将为某些元素提供一个变量给 yoru css 宽度。这将是一个根据许多不同的浏览器分辨率测试站点并进行调整以适应的过程。
祝你好运!
Unfortunatly, this is a key design element that is normally done in the very first stages of making a website. a Fixed width (and if so what desired size) or a fluid (percentile) website.
You will run into no end of issues if wordpress plugin's are set to pixels, and you try to rearrange it to %'s.
The short answer to your question is that its not just as simple as bunging in one line of code which would give a variable to yoru css width for some element. Its going to be a process of testing the site against many different browser resolutions, and adjusting to suit.
Best of luck!
该行代码调整浏览器大小以匹配屏幕尺寸。如果您希望最广泛的受众能够访问该网站,您仍然应该为 1024x768 编写网站。要么学习流畅的设计,但要确保它对于像您这样的大屏幕来说不会太大。
http://css-tricks.com/138-the-perfect-流体宽度布局/
That line of code resizes the browser to match the screen size. You should still code a website for 1024x768 if you want it reachable by the widest audience. Either that or learn about fluid designs, but make sure it doesn't get too big for large screens like yours.
http://css-tricks.com/138-the-perfect-fluid-width-layout/