Hi,
I'm fairly new to html/css but have a basic understanding of it and how it works...
I have a html select with a list of options, and I was using the CSS property min-width to give the select a minimum width of 250 pixels... I want the select box to grow if I add options to it that are > 250px, but never shrink below 250 px.
This works perfect in Firefox, but I need it to work for Internet Explorer as well. I have done some searching on the web, and found that IE doesnt support the min-width option in CSS. When the page loads, the select box is empty and in IE, it shows up with a width much closer to 0 pixels than the min-width of 250 px.
I need a workaround for this to make it work in IE. I found this site on the web that claims to have a workaround but I cant get it to work...
It talks about using IE's expression property to do something like this in the CSS file and this is quoted from the website...
width:expression(document.body.clientWidth > 800? "800px": "auto" );
I tried to modify it to work with minimum-width but it doesnt seem to be working. Here is what I tried...
width:expression(document.forms["orderForm"].orderItems.clientWidth < 250 ? "250px" : "auto" );
This should check if the width is < than 250, then set the clientWidth to 250 pixels, otherwise use the auto setting...
I checked outputting the document.forms["orderForm"].orderItems.clientWidth when I click on the select box to make sure that I was getting the right syntax and it was outputting the correct width. Maybe my javascript is wrong or something...
Any help or suggestions or other ways of doing this would be greatly appreciated...
Thanks much.
I'm fairly new to html/css but have a basic understanding of it and how it works...
I have a html select with a list of options, and I was using the CSS property min-width to give the select a minimum width of 250 pixels... I want the select box to grow if I add options to it that are > 250px, but never shrink below 250 px.
This works perfect in Firefox, but I need it to work for Internet Explorer as well. I have done some searching on the web, and found that IE doesnt support the min-width option in CSS. When the page loads, the select box is empty and in IE, it shows up with a width much closer to 0 pixels than the min-width of 250 px.
I need a workaround for this to make it work in IE. I found this site on the web that claims to have a workaround but I cant get it to work...
It talks about using IE's expression property to do something like this in the CSS file and this is quoted from the website...
width:expression(document.body.clientWidth > 800? "800px": "auto" );
I tried to modify it to work with minimum-width but it doesnt seem to be working. Here is what I tried...
width:expression(document.forms["orderForm"].orderItems.clientWidth < 250 ? "250px" : "auto" );
This should check if the width is < than 250, then set the clientWidth to 250 pixels, otherwise use the auto setting...
I checked outputting the document.forms["orderForm"].orderItems.clientWidth when I click on the select box to make sure that I was getting the right syntax and it was outputting the correct width. Maybe my javascript is wrong or something...
Any help or suggestions or other ways of doing this would be greatly appreciated...
Thanks much.