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.

Link to comment
Share on other sites

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">

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.