I've done a lot of searching and can't seem to find the answer to what I thought might be a fairly straight forward question.
I want to style a select on my page so that it is basically a green square with the selected number (1 - 20) shown in white in the middle.
Here is what I have so far:
select
{
width: 1.2em;
height: 1.5em;
background-color: #3CB23C;
-moz-border-radius: 0.2em;
border-radius: 0.2em;
border: 0.06em outset #666;
text-align: center;
color: #fff;
font-weight: bold;
font-size: 4em;
}
It looks fine so far but I cannot find anything on how to remove the arrow in order to make this look like a plain box with the number in.
(And before I get a thousand replies on why I shouldn't do this... I know. I have read them all before!! I'm not asking you to tell me if I should I'm asking how I do! It is for a mobile app where a number will be selected by tapping the green box and then choosing the number from the resulting list. It will be obvious what the box does so there is no need to get into an accessibility conversation here please).
I have read a lot about not being able to style selects and other form elements very easily and I have also read a lot of answers that go something like:
"You can't style the control it's self, but using JavaScript you can hide it and create a JavaScript functional control to act like a drop down list. When an item is selected it selects the item in the drop down list."
but then surprisingly few examples.
So does anyone have a way pf styling the arrow so that it 'disappears' or if it is not possible to use simply CSS to remove the arrow then does any one have any good examples of how to replicate this effect with Javascript?
Thank You