开发者

Resize XHTML with window

开发者 https://www.devze.com 2023-03-22 03:37 出处:网络
I\'ve done this in the past, but forgot how to do it. How can I set a \"master\" container in css/xhtml and have the website re开发者_C百科size with the browser window when resized?

I've done this in the past, but forgot how to do it.

How can I set a "master" container in css/xhtml and have the website re开发者_C百科size with the browser window when resized?

For example, if I have a "master" container div of 500px by 500px and a user resizes their browser window, how can I get that container to resize with it?

Thanks.


Simply use max-height and max-width instead of height and width.


You need to size your container using % rather than px.

This way it'll scale to fit the browser window as you resize it.

#container{
 width:90%;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消