Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the height and the font of a drop down list

Status
Not open for further replies.

Bibi

Programmer
Nov 8, 2000
10
CA
Hello!

I change the height and the font of a text input field with CSS (Cascading Style Sheet): input type=text {height: 18px; font: normal 8pt "helvetica, sans serif" }. But with the drop down list, I write: select {height: 18px; font: normal 8pt "helvetica, sans serif" } but that does not function.

What do I have to do?

Thank you in advance!
 
it's browser dependant - so it sometimes works for some elements, sometimes it does for all elements, sometimes it works for none ...
let us know which browser/version you're targetting
 
you may be able to put it in the options tag:

<select>
<option style=&quot;color:red;background-color:eek:range&quot;>dsad
<option>dsad
<option>dsad

</select>

...yeah you can in IE5.5 jared@aauser.com
 
Netscape does not seem read any styling of form elements.

Styling works in IE, but style the select tag, not the option.
Unfortunately NN4 will not pick these up, you may have to try putting in a div, but my attempt at styling thru that did not work either! &quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Well I just found that NN will read styling from the form tag, while IE does not. The only styles are those relating to font though, size,family,weight:

Cross browser font management for select box

<form style=&quot;font-family:Verdana;font-weight:bold&quot;><!-- NN-->
<select size=1 style=&quot;font-family:Verdana;font-weight:bold&quot;><!-- IE -->
<option>just this one</option>
<option>and another</option>
<option>just one more</option>

</select>
</form>

&quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
or, if you wanna have deveral different styles for your options, put the style-def in the options tags ;-) jared@aauser.com
 
Are you sure they're read? &quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top