Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select box IE question... 1

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
So I wrote some inline style code, and it worked wonderfuly! In Firebird... now to tweak it for IE...

Original (and what I actually want)

Code:
<select name=&quot;versions[]&quot; id=&quot;versions&quot; size=&quot;13&quot; multiple=&quot;multiple&quot;style=&quot;min-width:75px;text-align:right;&quot;>

Ok fine, so IE didn't like the min-width argument, I changed it to width, which ticks me off, since I now need to be extra careful with new data added to this select box (seeing as it's dynamically generated).

But, it won't recognize the text-align within a select box either? Is there anything I can do to get either or both of these tags working properly?

Thanks,
Rob
 
Rob,

The only way I've found to right-align the OPTIONS of a SELECT tag using IE (at least easily), is to use:
Code:
direction:rtl;
in the css of the SELECT tag.

I believe this only works in IE5 and higher, and would be ignored by other versions and other browsers.
Example:

Code:
<html>
<head>
<title>test</title>
<style type=&quot;text/css&quot;>
.sel{
   width:100px;
   direction:rtl;
}
</style>
<body>

<form name=&quot;pick&quot; action=&quot;&quot;>
   <select class=&quot;sel&quot; name=&quot;junk&quot; size=&quot;6&quot; ondblclick=&quot;javascript:alert(this.options[this.selectedIndex].text)&quot; >
      <option value=&quot;junk1&quot;>this</option>
      <option value=&quot;junk2&quot;>is  </option>
      <option align=&quot;junk3&quot;>a   </option>
      <option align=&quot;junk4&quot;>test</option>
   </select>
</form>

</body>
</html>
I really don't think Microsoft is implementing the direction property as it is intended to work, (at least for the SELECT tag), but it seems to accomplish what you want.

Here's a couple of references to the direction property:

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top