By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

Highlight or BOLD a single item in a drop down list

P: n/a
Bob
I've done this before, but can't find the simple code that allows
this.

I have a multiple item drop down created in a form with FrontPage
2002. I want to highlight or bold selected items, but not ALL the
items. The simple <b>BOLD</b> doesn't cut it. There is another
simple code that allows for this, highlighting, etc. Anyone know it?
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Els
Bob wrote:
I've done this before, but can't find the simple code that allows
this.

I have a multiple item drop down created in a form with FrontPage
2002. I want to highlight or bold selected items, but not ALL the
items. The simple <b>BOLD</b> doesn't cut it. There is another
simple code that allows for this, highlighting, etc. Anyone know it?


Are you looking for <em>emphasized text</em> ?

--
Els

Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #2

P: n/a
bo*@xta.com (Bob) wrote:
I've done this before, but can't find the simple code that allows
this.

I have a multiple item drop down created in a form with FrontPage
2002. I want to highlight or bold selected items, but not ALL the
items. The simple <b>BOLD</b> doesn't cut it. There is another
simple code that allows for this, highlighting, etc. Anyone know it?


In theory you would use some CSS, such as:
<option value="foo" style="font-weight: bold;">text</option>
or the equivalent using an external stylesheet and a class or id
selector.

However, it only works in Gecko.

Both IE and Gecko will support changing the color and background-color
of the text of individual options. Opera doesn't seem to support
styling individual options at all.

The only HTML method to emphasise a particular option is to change the
text itself. e.g.:
<option value="foo">TEXT</option>
or
<option value="foo">** text **</option>
or
<option value="foo">This option is important</option>

If this emphasis is critical for whatever reason then this very last
option is the only practical alternative when you take speech browsers
and the like into account.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3

P: n/a
Els
Steve Pugh wrote:
Els <el*********@tiscali.nl> wrote:
Bob wrote:
I have a multiple item drop down created in a form with FrontPage
2002. I want to highlight or bold selected items, but not ALL the
items. The simple <b>BOLD</b> doesn't cut it. There is another
simple code that allows for this, highlighting, etc. Anyone know it?


Are you looking for <em>emphasized text</em> ?


<option><em>text</em></option>
isn't valid is it?


Rethorical? ;-)

Sorry, I'm not too familiar with forms, and it didn't cross
my mind that it would be inside an <option> element.(yep,
call me stupid)
Suppose <option> isn't a block level element?

--
Els

Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #4

P: n/a
bo*@xta.com (Bob) wrote:
I have a multiple item drop down created in a form with FrontPage
2002.
Irrespectively of the method used to create the element, <select
multiple> does not work well. Most users are not familiar with the way it
works.
I want to highlight or bold selected items, but not ALL the
items.


Well, highlighting _all_ would be rather pointless, wouldn't it?

The short answer is that there is no way in HTML to emphasize an <option>
in a <select> element (except in the sense of making it pre-selected,
which might be seen as some kind of emphasis).

But as soon as you switch to a set of checkboxes, the problem vanishes in
a puff of logic: you can use
<div><input type="checkbox" id="foo42" name="foo" value="42">
<label for="foo42"><strong>special offer of today: 42
foos</strong><label></div>

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #5

P: n/a
Jay
"Bob" <bo*@xta.com> wrote in message
news:3d**************************@posting.google.c om...
I've done this before, but can't find the simple code that allows
this.

I have a multiple item drop down created in a form with FrontPage
2002. I want to highlight or bold selected items, but not ALL the
items. The simple <b>BOLD</b> doesn't cut it. There is another
simple code that allows for this, highlighting, etc. Anyone know it?


<select>
<option>Yes</option>
<option style="background-color: yellow">No</option>
<option>Maybe So</option>
</select>

I only tested with IE.

--
"Some see the glass as half-empty;
some see the glass as half-full.
I see the glass as too big." - George Carlin

- J
Jul 20 '05 #6

P: n/a
Bob
"Jay" <je******@yahoo.com> wrote in message news:<2s***************@news01.roc.ny>...
"Bob" <bo*@xta.com> wrote in message
news:3d**************************@posting.google.c om...
I've done this before, but can't find the simple code that allows
this.

I have a multiple item drop down created in a form with FrontPage
2002. I want to highlight or bold selected items, but not ALL the
items. The simple <b>BOLD</b> doesn't cut it. There is another
simple code that allows for this, highlighting, etc. Anyone know it?


<select>
<option>Yes</option>
<option style="background-color: yellow">No</option>
<option>Maybe So</option>
</select>

I only tested with IE.


This worked well and is the code. What if I don't want the highlight
as you show, but BOLD text instead?
Jul 20 '05 #7

P: n/a
On 4 Apr 2004 20:22:31 -0700, Bob <bo*@xta.com> wrote:
"Jay" <je******@yahoo.com> wrote in message
news:<2s***************@news01.roc.ny>...
<select>
<option>Yes</option>
<option style="background-color: yellow">No</option>
<option>Maybe So</option>
</select>

I only tested with IE.


This worked well and is the code. What if I don't want the highlight
as you show, but BOLD text instead?


Change the declaration from "background-color: yellow" to "font-weight:
bold".

But I'd advise against it. It will shift everything on the page and will
look really amateurish.
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.