[英]How do I get the page width in a css.
How do I get the page width in a css. 如何在CSS中获取页面宽度。 Getting window width/height is easy.
获取窗口的宽度/高度很容易。 eg: Height: 100% sets the height to 100% of the window height.
例如:高度:100%将高度设置为窗口高度的100%。 I want to set it to 100% of the page size.
我想将其设置为页面大小的100%。 because if we zoom when using window size, max size it takes is of the window.
因为如果我们在使用窗口大小时进行缩放,则它所占用的最大大小就是该窗口。
jquery can give you a solution as follows: jQuery可以为您提供以下解决方案:
$(window).height(); // returns height of browser viewport
$(document).height(); // returns height of HTML document
so you can use $(document).height();
因此您可以使用
$(document).height();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.