Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / November 2003



Tip: Looking for answers? Try searching our database.

min-width in IE6?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Holli Graham - 21 Nov 2003 23:18 GMT
Hi all,

I'm checking to see if anyone knows of a hack or trick or whatever to
get IE6 to keep a minimum width of a tableless page.  I have the
entire page content wrapped in a container div called bodywrap that
sets the min-width to 760px and I added the spacer.gif for IE5.x and
NN4 in the body of the html and added the trick suggested here:
http://www.svendtofte.com/code/max_width_in_ie  The trick worked when
IE6 was running in quirks mode, but in standards mode it doesn't.
BTW, my code can't be XHTML compliant because I'm creating templates
for other people to maintain who wouldn't have any idea how to do
that.  This works in IE5.5, NN7 and Opera7.  Here is what my relevant
code looks like:

Doctype...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

Styles...

body {
    margin: 0;
    padding: 0;
    background: #FFFFFF;
       color: #000000;
}
/* need this so the browser won't squish the content smaller than
760px */
#bodywrap {
    width: 100%;
    min-width: 760px;
/* hack for stupid IE6 */   
    width:expression(document.body.clientWidth < 760? "760px": "auto" );
}

Code...
<body>
<div id="bodywrap">
<!-- hack so IE5.x and NN4.x will keep a minimum width -->
<img src="images/spacer.gif" width="760" height="1">
.
.
.
</div>
</body>

Thanks for any help!  I've looked all over the web and newsgroups and
this is my last resort!
Holli
Jukka K. Korpela - 21 Nov 2003 23:47 GMT
> I'm checking to see if anyone knows of a hack or trick or whatever to
> get IE6 to keep a minimum width of a tableless page.

Why on &Planet; would you do that? I can see the point in setting a
_maximum_ width, but do you really want to force horizontal scrolling
whenever the canvas width is less than 760 pixels (or, on print, chopping
off the ends of lines)?

> I have the
> entire page content wrapped in a container div called bodywrap that
> sets the min-width to 760px and I added the spacer.gif - -

If you are playing with _such_ hacks, I don't really see what the problem
is, technically. If your document simply contains a 760 pixels wide image,
why wouldn't a browser make the document at least 760 pixels wide? (This is
really a _problem_ rather than a solution in any normal case, but I already
told that.) As usual, if we could see the URL...

> BTW, my code can't be XHTML compliant because I'm creating templates
> for other people to maintain who wouldn't have any idea how to do
> that.

I'm afraid you are seriously misguided. Especially if people who maintain
the pages don't understand markup issues, you should create valid markup for
them.

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">

Why do say that if you know that the markup "cannot" be valid? Surely if it
can be valid HTML, it's very trivial to make it valid XHTML (if you know
what XHTML actually is).

Signature

Yucca, http://www.cs.tut.fi/~jkorpela/

Holli Graham - 24 Nov 2003 14:58 GMT
I guess I should've specified "NO LECTURES PLEASE!"

I didn't come here for a lecture. I came here to find out if any css
gurus might know the solution to my problem.  Sorry, I don't have a
public site to test on, but I pasted the relevant html.  I can always
copy and paste the whole thing, but I don't think that's necessary.

And, FYI, putting a hack spacer gif at the top of your document keeps
a horizontal scroll bar, but still lets all the floats and everything
underneath it stack on top of each other.

So, does anyone have a solution to the IE6 min-width problem?

Thanks!
Holli

> > I'm checking to see if anyone knows of a hack or trick or whatever to
> > get IE6 to keep a minimum width of a tableless page.
[quoted text clipped - 28 lines]
> can be valid HTML, it's very trivial to make it valid XHTML (if you know
> what XHTML actually is).
Brian - 24 Nov 2003 15:08 GMT
How am I supposed to post my replies in a newsgroup?:
 http://allmyfaqs.com/faq.pl?How_to_post

> I guess I should've specified "NO LECTURES PLEASE!"

And what would that have accomplished?

> I didn't come here for a lecture. I came here to find out if any css
> gurus might know the solution to my problem.  Sorry, I don't have a
> public site to test on,

Are you authoring for the www?  (That is the topic of this group.)
Create a test directory and post there.

> So, does anyone have a solution to the IE6 min-width problem?

As you already appear to know, IE/Win ignores min and max width and
height.  The best solution I can think to offer you is to rethink your
approach, design flexibly, and don't try to specify a min-width on the
page.  It is terrible for usability.

Signature

Brian
follow the directions in my address to email me

Alan J. Flavell - 24 Nov 2003 16:41 GMT
> I guess I should've specified "NO LECTURES PLEASE!"

I guess we should have recognised right away that you came here for a
free handout, rather than to participate in a usenet discussion.
Erik Funkenbusch - 25 Nov 2003 07:54 GMT
> I guess I should've specified "NO LECTURES PLEASE!"

Sometimes, listening to a lecture is the price for gaining free advice.  

Would it really kill you to nod politely and perhaps counter with your
position rather than rudely tell someone that is offering you advice that
you want to dictate the terms they can offer it under?

Does having to read a lecture cause you physical pain and discomfort such
that it's impossible for you to ignore or even *gasp* consider it?

Yes, I'm being sarcastic, and perhaps even lecturing a little myself.  But
it does irk me that you can ask for advice and then be rude to the people
that offer it to you.
Philipp Lenssen - 24 Nov 2003 15:12 GMT
> Hi all,
>
[quoted text clipped - 9 lines]
> that.  This works in IE5.5, NN7 and Opera7.  Here is what my relevant
> code looks like:

In strict-mode, IE6 takes the wrapping element's width and if an image
in the content is larger than it, it still resizes the rest of the
contained elements to the wrapping width. In quirks mode or older
versions of the browser, it resizes all the preceding and following
elements to the width of the overlarge image. AFAIK min- and max-width
properties are altogether ignored. Just setting a width and getting rid
of the spacer-gif should work, or doesn't it? And are you sure you want
to support broken NN4?
Holli Graham - 25 Nov 2003 05:20 GMT
Thanks for explaining that Philipp.  IE6 just hasn't caught up with
the other browsers yet and doesn't support the min-width property.
Hopefully, they'll support it in the next version.  IE6 does now
support min-height if you're wondering, although I can't think of a
use for that off the top of my head.  Unfortunately, I don't have a
lot of control where I work.  I can suggest things, but I have no
direct control over anything once the templates leave my hands.  It
has been a struggle trying to convince everyone that we need to be
more accessible and move toward standards coding.  A lot of these
people worked in print for years and want things to look "just so."
And, yes, we still have to code for NN4, but, hopefully, not for much
longer.  I have alternate styles for that and print, so that's okay.
Maintaining a min-width is a small compromise to make for them to
agree to tableless, liquid layouts, and allow font resizing. Maybe in
the next redesign, we can get everyone using XHTML. :)

I did find a javascript hack that will make the min-width property
work in IE browsers. With a little tweaking, I was able to use it and
delete the spacer.gif.  It won't work for NN4 users or people with
javascript turned off, but that's okay.  That's a small percentage of
people, and they'll still be able to see the page without any trouble.
For anyone searching this newsgroup for answers to this question who
don't want to endure a tongue lashing.  The js hack I mentioned is
explained here: http://forums.devshed.com/t45964/s.html

Thanks again for your help Philipp!
Holli

> > Hi all,
> >
[quoted text clipped - 18 lines]
> of the spacer-gif should work, or doesn't it? And are you sure you want
> to support broken NN4?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.