How to properly set the 100% DIV height to match document/window height?

前端 未结 9 1834
难免孤独
难免孤独 2021-01-30 04:53

I have a wrapper positioned to center with an y-repeated background image:


    
...some content
&
9条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 05:06

    The easiest way is to add the:

    $('#ID').css("height", $(document).height());
    

    after the correct page height is determined by the browser. If the document height is changed once more re-run the above code.

提交回复
热议问题