Render scrollbar in listbox by CSS

K

kurt sune

How do I render the scrollbars by CSS in a listbox?

I have understood that an asp listbox gets rendered as a select element.

So I tried first by adding a style element:
..TA {scrollbar-3dlight-color:aqua;

scrollbar-arrow-color:fuchsia;

scrollbar-base-color:fuchsia;

scrollbar-darkshadow-color:;

scrollbar-face-color:blue;

scrollbar-highlight-color:chartreuse;

scrollbar-shadow-color:lightsalmon}



And then an html select:

<select size="4" name="LBox1" id="LBox1" class="TA" style="width: 213px;
height: 51px">

<option value="sune">une</option>

<option value="sune">une</option>

<option value="sune">une</option>

<option value="sune">une</option>

<option value="sune">une</option>

<option value="sune">une</option>

<option value="sune">une</option>

<option value="sune">une</option>

</select>



By this the scrollbar gets rendered colored in the IDE, but not in the
browser (IE6.0).



Then I try adding the TA class as cssclass for the listbox:

<asp:ListBox ID="ListBox1" runat="server" CssClass="TA"></asp:ListBox>





By this the scrollbar does not gets rendered colored in the IDE, and not in
the browser (IE6.0).



An asp textbox gets rendered correctly.

Why not a listbox?



/k
 
C

Cowboy \(Gregory A. Beamer\)

Not sure, but overflow is the way to do it in a DIV tag.

style="overflow:scroll;"


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 
P

Przemek Ptasznik

Cowboy (Gregory A. Beamer) napisa³(a):
Not sure, but overflow is the way to do it in a DIV tag.

style="overflow:scroll;"

The "select" html element is very specific and you're not able to apply
css rules to it.
Styling scrollbars is generally bad idea, because it's not a part of css
specification and works in IE only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top