views:

1535

answers:

5

Is it possible to get min/max width working in IE6 without the use of javascript?

On a somewhat related note, does Google Chrome not understand,

<!--[if IE 6]><!-->
<!--<![endif]-->

or am I just screwing up that code. Thanks.

+6  A: 

First question: no. You can sorta hack it using tables and images, but not in any way that approaches the ease of use of max-/min-width.

Second question: no - it sees them the same as every other non-IE browser, as comments. Perhaps you wanted:

<!--[if IE 6]>
something IE6 should see
<![endif]-->

Note how the XML/HTML comment begins on the first line and doesn't end until the last.

Shog9
A: 

Yeah, that's the 'downlevel revealed' conditional comment syntax. It validates, but there's not much use besides that. I suggest using the format Shog9 has listed.

Alex JL
That's downlevel hidden, actually, since it's hidden inside comments.
apphacker
Actually, I see the extra comment syntax, which is not how you're supposed to do that.
apphacker
That is how you downlevel-revealed whilst keeping valid/well-formed. The MS-recommended syntax without the extra comments is invalid. It's useful for tests like ‘if IE 8’ to supply the same code to standards-compliant browsers inluding IE8.
bobince
A: 

Yes you're screwing that up. If you want downlevel revealed it should look like:

<![if IE 6]>
do something
<![endif]>

That will make the 'do something' code appear for IE 6, and all other non-IE browsers. IE 7, and IE 8 will not make whatever 'do something' is viewable.

apphacker
Won't work - it must be a comment:<!--[if IE 6]>something IE6 should see<![endif]-->Let's check our answers before trying to help, mmmkay? :)
MaxVT
MaxVT, according to The Ultimate CSS Reference by SitePoint, apphacker has specified a syntax recommended by Microsoft - so you might apply your comment to your own comment.
Alex JL
It will work, and is MS's preferred code, but it's not valid markup. smith's version also works and is valid; it's just a bit odd to target (IE6 plus standards-compliant browsers)... presumbly he wanted a downlevel-hidden cc.
bobince
A: 
kalyan
A: 

Regarding the CSS Conditional comments The problem is that what the user want is to somehow show all data to all browsers while skipping IE6 In order to display information to all browsers WHLE THAT IS NOT READ by IE6 u can do this. http://alexdweb.com/blog/2010/01/09/conditional-comments-for-ie/ for all the explanation and examples

AlexD