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%;
}
精彩评论