Forum Moderators: open
I added tags around my page logo. I set the font type and set the size to 27px. I added a { white-space: nowrap } tag around the logo column. When my browser window is reduced to around 600 pixels it creates a horizontal scrollbar. I tested it with Moz 1.6, IE 6 and Opera 7 with no problems. It even spaced them all exactly the same. It doesn't seem to effect the layout of the page in Lynx browser either.
I am just wondering if anyone can think of any cons to using this method to keep a minimum page width.
Thanks in advance.
You could even use a relative font size (such as em), which will allow the user to resize their browser text and the document would still have the correct minimum width for the new text size.
e.g.
CSS:
#content {
border: 2px solid #00f;
min-width: 500px;
}
.minwidth {
width: 500px;
}
HTML:
<div id="content">
<div class="minwidth"></div>
</div>
Here the content div expands to 100% width but is never allowed to be less than 500 pixels wide.
The minwidth div fixes IE and other browsers (with decent CSS support) are handled with the min-width attribute on content.
grahamstewart you are a lifesaver. It worked. I don't quite understand how it worked. I thought the min-width wasn't supported in IE?!?
I have another question for you.
I tried going to a tableless layout using div but ran into a problem where when a person makes the width too thin the content would overlap itself when using absolute positioning. I could stop it in mozilla adding the min-width tag in my html tag. Will the method of using min-width in the div tag itself also stop my website from overlapping itself.
I can test it myself but if you already know you could save me a lot of time.
Thanks.
But you still need the min-width tag as well.
IE refuses to let the 'minwidth' div stick out of the 'content' div so it doesn't let it get any smaller.
But most other browsers allow the 'minwidth' div to break the border of the 'content' so you also require a min-width setting on content to prevent this.