How to implement a web page that scales when the browser window is resized?

后端 未结 11 876
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 15:42

How to implement a web page that scales when the browser window is resized?

I can lay out the elements of the page using either a table or CSS float sections, but i

11条回答
  •  误落风尘
    2020-12-29 15:48

    Use percentages! Say you have a "main pane" on which all your page's content lies. You want it to be centered in the window, always, and 80% of the width of the window.

    Simply do this:
    #centerpane{ margin: auto; width: 80%; }

    Tada!

提交回复
热议问题