No replies
quicksigns
quicksigns's picture
Offline
newbie
Last seen: 8 years 31 weeks ago
Timezone: GMT-6
Joined: 2012-01-08
Posts: 1
Points: 2

I've been working on this for the last half hour or so and can't seem to come up with a solution. I'm hoping I can do this by only editing the CSS or only the CSS and the PHP below.

What I am trying to do is make each option have its own unique background and text color. Red would have a Red background and White text where Black would have a Black background with White text and Yellow would have a Yellow background and Black text.

Maybe someone can come up with the answer. I know CSS isn't extremely complex, but I am stumped and someone may find this very useful.

If you have any ideas, please post and I can try it out. I'll be here all week Smile

Thanks for looking.

...and here is my code:

       <div id="option-227" class="option">
 
 
          <span class="required">*</span>
 
 
          <b>Imprint Color:</b><br />
 
          <select name="option[227]">
 
            <option value=""> --- Please Select --- </option>
 
 
            <option value="17">Red
 
            </option>
 
 
            <option value="18">Blue
 
            </option>
 
 
            <option value="19">Yellow
 
            </option>
 
 
          </select>
 
        </div>

PHP

<select name="option[<?php echo $option['product_option_id']; ?>]">
 
            <option value=""><?php echo $text_select; ?></option>
 
            <?php foreach ($option['option_value'] as $option_value) { ?>
 
            <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
 
            <?php if ($option_value['price']) { ?>
 
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
 
            <?php } ?>
 
            </option>
 
            <?php } ?>
 
          </select>