position of options in HTML select element

Posted by frenchie on Stack Overflow See other posts from Stack Overflow or by frenchie
Published on 2012-11-04T22:47:09Z Indexed on 2012/11/04 23:00 UTC
Read the original article Hit count: 269

Filed under:
|

I have a element that contains options. The element is 150px wide but some of the options are wider. So when rendering, the browser shows the overflow to the right. How can I make the options list overflow to the left? JSFiddle

Thanks.

<select id="MySelect">
      <option value="60" selected="selected"></option><option value="-60">(UTC-01:00) Azores</option>
      <option value="-60">(UTC-01:00) Cape Verde Is.</option><option value="0">(UTC) Casablanca</option>
      <option value="0">(UTC) Dublin, Edinburgh, Lisbon, London</option><option value="0">(UTC) Monrovia, Reykjavik</option>
      <option value="60">(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>
      <option value="60">(UTC+01:00) Brussels, Copenhagen, Madrid, Paris</option>
      <option value="60">(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb</option>
      <option value="60">(UTC+01:00) West Central Africa</option>
      <option value="120">(UTC+01:00) Windhoek</option>
</select>??????????????????????????????????????????????

?#MySelect{
    margin-top:20px;
    margin-left:200px;
    width:150px;}???

© Stack Overflow or respective owner

Related posts about html

Related posts about css