简体   繁体   English

CSS宽度问题与缩放

[英]Css width issue with zooming

is there any elegant way of stretching a div to the entire html, rather than the viewport? 有没有一种优雅的方法来将div扩展到整个html,而不是视口?
http://pastebin.com/iU6e92xy http://pastebin.com/iU6e92xy
whenever you zoom and horizontal scrollbars appear, the 'test' div only extends to the initial viewport. 每当您缩放并显示水平滚动条时,“ test” div只会扩展到初始视口。

Now i am using jquery to acchieve the effect 现在我正在使用jQuery来达到效果

$(window).resize(function(){
    $('#test').css('min-width',$(document).width()+'px');
});

TIA TIA

The code below will work for you: 以下代码将为您工作:

$(window).resize(function(){
    var windowWidth = $(window).width();
    $('#test').css('minWidth', windowWidth); 
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM