Connecting Tech Pros Worldwide Help | Site Map

Can < OPTION > be colored

Member
 
Join Date: Oct 2006
Posts: 102
#1: Nov 4 '08
Thats my Question
is it possible in Php to make the option items colored or to highlight some items.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,936
#2: Nov 4 '08

re: Can < OPTION > be colored


Ok, I will tell you once: don't over do it with your punctuation. A million periods or question marks will only anger others and not get your question answered sooner. So quit it.

Can option be colored? PHP doesn't style an html elements, it can set the style of an element but PHP doesn't do this directly.

Why use PHP to do this? Pointless.

I'll move this over to HTML because either its more suited there, or your question provided no information whatsoever.

--Moved to HTML
Member
 
Join Date: Oct 2006
Posts: 102
#3: Nov 5 '08

re: Can < OPTION > be colored


Am i asking something that strange ?

hasn't anyone tried before to highlight the items in a combo box !
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 900
#4: Nov 5 '08

re: Can < OPTION > be colored


You can. Here is one way.

Expand|Select|Wrap|Line Numbers
  1. <select>
  2.     <option style='color:red; font-weight:700;' value='Red'>Red</option>
  3.     <option style='color:blue; font-weight:700;' value='Blue'>Blue</option>
  4.     <option style='color:green; font-weight:700;' value='Green'>Green</option>
  5.     <option style='color:gold; font-weight:700;' value='Gold'>Gold</option>
  6. </select>
--Kevin
Member
 
Join Date: Oct 2006
Posts: 102
#5: Nov 5 '08

re: Can < OPTION > be colored


Can't Thank U Enough
Reply