1

I would like to know how to remove the scroll bar from the select dropdown list? I have also tried overflow: hidden; but it doesn't work in Firefox.

CSS:

.search_pulldown_txtbox1
{
    height:120px;
    overflow:hidden;
    width: 160px;
    margin-top:8px;
    background-image:none;
    margin-left:10px;
    line-height: 14px;
}

HTML:

<select name="keyword_select" multiple="multiple" class="search_pulldown_txtbox">
    <option> 1</option>
    <option> 2</option>
    <option> 3</option>
</select>
Marty
  • 39,033
  • 19
  • 93
  • 162
moredesires
  • 11
  • 1
  • 1
  • 3
  • 1
    I would assume that you can't. At best it would be very platform specific. Some aspects of form elements you don't (and shouldn't) have styling control over. – user229044 Jun 10 '11 at 02:52

2 Answers2

2

<select>s are notoriously difficult to style. Each browser renders them differently. If you really must control the look and feel of a <select>, then you may have to resort to custom components built from other HTML elements. E.g. this one.

David Tang
  • 92,262
  • 30
  • 167
  • 149
  • I'm with Box9, mimicking Select functionality and integrating the custom component into your form handling would give you much more consistent flexibility. – danjah Jun 10 '11 at 03:12
0

Hide vertical scrollbar in <select> element

Community
  • 1
  • 1
Phphelp
  • 1,290
  • 2
  • 14
  • 25
  • but i am not sure of how many data it will receive.because coming from database.Also i had tried size="3" for testing even doesn;t work – moredesires Jun 10 '11 at 03:10