Forum Moderators: open

Message Too Old, No Replies

Setting Different Text Colors for Sections in a 'Jump Menu'

         

markd

9:01 pm on Nov 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello all

I am creating a 'jump menu' in Dreamweaver MX 2004 and wondered if there was any way I could assign attributes to the text/list entries in the menu?

For example, items in the jump menu are divided into areas, such as

'Widgets'
Blue Widgets
Green Widgets

'Large Widgets'
X Large
XX Large

I would like to colour the Widgets entry in a 'blue' and the 'Large Widgets' in a 'red' etc.

Here's a snip of the code which is being generated:

<select name="Application Areas" class="rolldowncopy" id="Application Areas" onChange="MM_jumpMenu('parent',this,1)">
<option value="#" selected>Application Areas - Quick Links</option>
<option value="#">Application area 1:</option>
<option value="site/area1.htm"> Blue Widgets </option>

I have applied a CSS class to control the basic text size. If I were to add a colour attribute to this CSS it would presumably colour all text to this value?

Whereas I actually want to be able to assign a number of colours to each 'section' of the jump menu.

Any thoughts appreciated.

Many thanks

Mark

iamlost

11:37 pm on Nov 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can either add a colour "class" to your CSS or an inline style to each option:

CSS:
.option-red {background-color: #f00;}

HTML:


<select name="Application Areas" class="rolldowncopy" id="Application Areas" onChange="MM_jumpMenu('parent',this,1)">
<option class="option-red" value="#" selected>Application Areas - Quick Links</option>
<option value="#">Application area 1:</option>
<option style="background-color: #ff0;" value="site/area1.htm"> Blue Widgets </option>

markd

10:24 am on Dec 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks so much iamlost - it worked first time, precisely what I was hoping for.

Leads me to think... I wish I was 'aslost' as you! :)

Thanks so much