Back to main page!

Knowledgebase Home Knowledgebase Home
Search the Knowledgebase Browse by Category
How do I force a minimum width for my page?
User Opinions
No users have voted.

How would you rate this answer?
Helpful
Not helpful
Normally, web browsers will try to lay out your text and images so that they fit in the available horizontal space. Some page designs do not respond well to this. It is possible to force the browser to lay out your content at a specific width via two methods.

The simple, elegant way that works with all modern browsers (now more than 99% of browsers overall) is to use CSS (cascading style sheets). Wrap your entire page in a <div> element with a width attribute, like this:

<div style="width: 2000">
Your page body goes here
</div>
Notice that a horizontal scrollbar appears to allow the entire 2,000-pixel width to be seen, even though the content in this simple example doesn't come close to requiring it.

The old-fashioned way that works with all web browsers, including truly ancient browsers like Netscape 4.x, is to use an image as a "brace" to prop the window open at the desired minimum width. Use a 1x1 transparent GIF image. Then use the following HTML:

<img src="transparent.gif" width="2000" height="1"><br>

This will force the page to be at least 2000 pixels wide, creating a scrollbar if necessary.

Visitor Comments
No visitor comments posted. Post a comment
Related Questions
Attachments
No attachments were found.

Home | Web Design | Print Advertisements | Banner Design | Other Services


Copyright © 2003 Digital Arts Group @ FrankGonzalez.com. All Rights Reserved
About Us | Disclaimer | Privacy Policy | Terms of Use | Design Team | Sitemap