Is there any secret behind editing a option tag with css? I just can’t solve this issue
<option> FirstName <span class = "foo">SecondName</span> </option>
.foo{
color:#666666;
}
What am I missing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
<option>elements cannot contain anything other than text. So no, you can’t apply a style to a section of their content.Just don’t use a
<select>, or don’t bother about styling. From your use case, it doesn’t really look suitable anyway. It’d be better just to type the name, wouldn’t it?