开发者

Resize XHTML with window

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜