smith
smith

Reputation:

Min/Max Width in IE6 without javascript?

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.

Upvotes: 2

Views: 2535

Answers (4)

bluwater2001
bluwater2001

Reputation: 7959

Here is the simplest solution !!! Before I start i must tell you dropdown select box will automatically expand in almost all the browsers except IE6.so.. i would do a browser check [ i.e., IE6] and write the following only to that browser.Here it goes..First check for the browser..

The code will magically expands the dropdown select box.The only problem with the solution is onmouseover the dropdown will be expanded to 420px.. and because the overflow = hidden we are hiding the expanded dropdown size and showing it as 170px;so, the arrow at the right side of the ddl will be hidden and cannot be seen. but the select box will be expanded to 420px; which is what we really want. just try the below code for yourself and use it if you like it. Cheers.

.ctrDropDown { width:420px; } .ctrDropDownClick { width:420px; }

the above is the IE6 css. the common css [for all other browsers] should be as below.

    .ctrDropDown
{
    width:170px; <%--this is the actual width of the dropdown list--%>
}
.ctrDropDownClick
{
    width:auto; <%-- this the width of the dropdown select box.--%>
}

Upvotes: 0

Bjorn
Bjorn

Reputation: 71830

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.

Upvotes: 0

JAL
JAL

Reputation: 21563

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.

Upvotes: 0

Shog9
Shog9

Reputation: 159618

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.

Upvotes: 10

Related Questions