Click to See Complete Forum and Search --> : forms and styles


Nulrick
02-08-2005, 05:24 PM
I am trying to apply some styles to my form drop down menu.. specifically line height and font size.. but I can't get the style to work.. I've tried using an external style, internal style, local style, div tags, and the old fashion "font-size" tag around each "option" in the drop down menu.. nothing works.. can styles not be applied to forms? If yes, then how?

MstrBob
02-08-2005, 07:27 PM
Font size can be applied directly as

option {
font-size:1.5em;
}

And the like. Line-height doesn't seem to work as well, but you could subsitute that with padding, no?

Nulrick
02-09-2005, 11:20 AM
so I place it locally after the option tag, or as a style in the style sheet?

NogDog
02-09-2005, 12:09 PM
Originally posted by Nulrick
so I place it locally after the option tag, or as a style in the style sheet?
Either, whichever makes sense for what you are trying to do.

I did a little experimenting with IE6 and so far the only thing I could effect at the "option" level was the colors, while I could set font attributes at the "select" level:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<title>Untitled</title>
<style type="text/css">
<!--
select {
font: large "courier new", courier, monospace;
font-weight: bold;
width: 8em;
}
option {
color: blue;
background-color: yellow;
}
-->
</style>
</head>
<body>

<form action="#" method=post>
<p>
<select name=test>
<option>Default</option>
<option style="color: red; background-color: cyan">Red</option>
<option style="color: green;">Green</option>
<option>Blue</option>
</select>
</p>
</form>

</body>
</html>

Nulrick
02-10-2005, 02:13 PM
thanks for your help.. i got most styles to work.. just cannot get the line-height style to work anywhere.. very annoying..