Setting Height of Selectbox (Combobox) in IE

      

Working with Internet Explorer and creating web pages that behaves same in IE has always been frustrating for many web developers. One way of tackling IE problem is to create IE-Specific Stylesheet and thus it helps in avoiding breaking of design in IE.

While working on one of the requirement I had to set height of selectboxes on the webpage. Normally for setting up height of any html component we apply stylesheet. For example:

select {
	height: 50px;
}

The above technique work for most of the browsers except Internet Explorer. The combo box does not take the height specified in CSS and is displayed with the default height only.

I tried searching Internet to see if there are some IE Specific Hacks to increase the height of the listbox. But I couldn’t find a useful fix.

Finally I end up using a workaround of fixing height issue of selectbox in IE. Just increase font size of the select box and that will increase size of it.

select {
	font-size: 15px;
}

The above workaround is working for me. If you find any other useful trick for this problem please share it by comment on this article.


Facebook  Twitter      Stumbleupon  Delicious
  

3 Comments on “Setting Height of Selectbox (Combobox) in IE”

  • Stefan wrote on 4 November, 2009, 17:03

    It seems to be related with the IE0s *has-layout* flag.
    If found that it works, if the width is given, too.
    select {
    height: 120px;
    width: 120px;
    }

  • John wrote on 21 March, 2010, 23:23

    I also had cross browser success by styling the option element:

    option {
    height: 20px;
    }

  • Tony Jah wrote on 10 June, 2010, 14:44

    Set Font size to higher pixels

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

Copyright © 2010 ViralPatel.net. All rights reserved.