Jump to content

How can i control the location of html select option.


cesarcesar

Recommended Posts

I have a page where the <select> is very screen right. it has little room to show the full name in the <option> so i do like "S - Summary". You only end up seen the S. When the dropdown happens, my clients wants to see the whole name. This works in FF, but not IE. Can i via CSS control the location of the options. Say move them left 50px. Thanks.

Yes. Create a class for your select and put it in an "ie-only.css" file.

 

.select {
margin-right:50px;
}

 

Then use a conditional expression in your <head> after any other css links or commands to call the css file if the browser is IE (this way it doesn't change how it looks in FF).

 

<!--[if lt ie 6]>
<link rel="stylesheet" type="text/css" media="screen" href="ie-only.css" />
<![endif]-->

 

For the actual select tag, simply add the class,

 

<select  name="select" class="select">

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.