运行时如何找到浏览器的宽度和高度

运行时如何找到浏览器的宽度和高度

问题描述:

i使用视觉stdio2008
感谢

i using visual stdio2008
thanks

克里斯蒂安(Cristian)给了您答案.但是,任何基于此信息的设计都是一个坏主意.取而代之的是,您应该设计一种布局,无论Web浏览器窗口的工作区大小如何,其表现都很好,而无需使用JavaScript,而只需使用CSS.避免绝对定位,使所有内容流畅.使其尽可能简单,但不要简单. :-)

—SA
Cristian gave you the answer. However, any design based on this information is a bad idea. Instead, you should design a layout which behaves nicely regardless of the size of the client area of the Web browser''s window, without using JavaScript, just CSS. Avoid absolute positioning, make everything fluid. Keep it as simple as possible, but not simpler. :-)

—SA


我想第一件事是向您解释互联网的工作原理.您的浏览器不在乎是什么生成了HTML,更不用说您使用了什么IDE.它不能告诉这些事情.您使用javascript来做到这一点.

此处 [ ^ ]是我通过在google中输入问题找到的文章.
I guess the first thing is to explain to you how the internet works. Your browser does not care what generated your HTML, let alone what IDE you used. It cannot tell these things. You use javascript to do this.

Here[^] is the article I found by typing your question in to google.