FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

how to underline a select option?

 


nisibdv
I want to underline a select option so when the drop down list opens it have the following look:

Select
-------
Option1
Option2
etc.

I tried with <option><u>Select</u></option>
<option> Option 1 </option>
<option> Option 2 </option>

but it doesn't work. Do you know how to do it?
wabik90
Maybe you should try with css:

Code:

<select>

<option style="text-decoration:underline;">Select</option>
<option>Option 1</option>
<option> Option 2 </option>

</select>


It should work on FireFox(i checked it;-), but I don't know how it looks on IE. Should work!

Cheers
ptolomeo
I tried it on IE but doesn't work. It works fine on firefox as you said.
Moreover, I would like the underline to be a dashed line. Is it possible?

Thanks
ashok
You can't do that with text-decoration. Try using border...
Code:
<select>

<option style="border-bottom: 1px dashed black">Select</option>
<option>Option 1</option>
<option> Option 2 </option>

</select>


Haven't tested it. Post the result here...
wabik90
ashok wrote:
You can't do that with text-decoration. Try using border...
(...)


Why not? I tested it and it works! So why did you say that i can't? Confused
takashiro
I don't think it possible it can be show in IE. IE seems to not support it.
phpc0d3r
Check this out:
Code:

<select>
<optgroup label="Swedish Cars">
<option value ="volvo">Volvo</option>
<option value ="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value ="mercedes">Mercedes</option>
<option value ="audi">Audi</option>
</optgroup>
</select>


http://www.w3schools.com/tags/tag_optgroup.asp (Page I pulled the code from)
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.