• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

need horizontal scrollbar for a select box which has fixed width

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to add a horizontal scroll bar in select box which has fixed width.i tried using overflow:auto; it is not working properly is there any other solution.
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ram,

Is it not working properly or not working at all?

Anyway, can you post some code?

Herman
 
ram chml
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<div style="overflow-x:scroll;width:300px;" align="left">
<select name="selectedTree" id="selectedTree" multiple size="16" align="left">
</div>

i tried like this it works for options with large text but if the option is having text size small means the select box width got reduced but i want a select box with fixed width for both large(need horizontal scroll bar) and small text.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
overflow-x is IE only

Eric
 
ram chml
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried like this
<div style="overflow:auto;width:300px;" align="left">
<select name="selectedTree" id="selectedTree" multiple size="16" align="left">
</select>
</div>
 
Author
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you add a horizontal scrollbar to an element?

The overflow design pattern in chapter 6 of my book, Pro CSS and HTML Design Patterns, shows exactly how to do this.

You can see an example of overflow in action at http://www.cssdesignpatterns.com/Chapter%2006%20-%20BOX%20MODEL%20PROPERTIES/Overflow/example.html

Ram Chml's code is a great example of how to do this. (Be sure, though, not to embed CSS directly within the style attribute of an element because this makes your code hard to maintain � instead use a class attribute and style the class in your stylesheet).

I don't yet recommend overflow-x or overflow-y because Opera 9 doesn't support these properties -- although all the other major browsers do.

Lastly, I don't generally recommend using overflow because it annoys users when they have to scroll to see something. Of course, I'm sure your case is one of the many exceptions to this generalization.
[ October 12, 2007: Message edited by: Mike Bowers ]
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


May be this can help you........
 
Get off me! Here, read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic