setting maximum web page width
What is the easiest/best way to set the maximum width of a web page. For example assume I don't want to let the user to expand the width beyond 400px. HTML code, CSS, C#?
I am using Visual Studio 2008 C# environment开发者_JAVA技巧.
Thanks Bruce
If you want to limit the browser width, well you can't do that :P
Alternatively, if you want to limit a certain element's width, such as a div with an ID of #container
, then you would use CSS:
#container {
max-width:400px;
}
Wrap the content of the page is some sort of container (a <div>
) is usually suitable. Apply the max-width
property to it.
Simply make a fixed width CSS layout set at 400px.
Trying to prevent the browser window to be greater than 400px is horrible idea, and will fail in more ways than it will work (mobile, etc).
精彩评论