473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Highlight or BOLD a single item in a drop down list

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
7 44125
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 vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #2
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
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 vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #4
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: michael | last post by:
Is it possible for a single-level css dropmenu, whereby headings are aligned horizontally in navbar style, and their subpoints appearing directly below on hover, to have the following list...
3
by: mal | last post by:
Sorry for repost - system added to another subject for some reason Have tried numerous ideas from the group to solve this one. It is such a simple example that it should be straightforward ! I...
1
by: Null | last post by:
Hello -- Is there a way to prevent the autopostback of a drop down list if there is a "default" item in the list -- example, a drop down list where the first item says "Select One" and the...
3
by: John Morgan | last post by:
I am using a database to populate a drop down list using myDropDownList.DataSource = myCmd.ExecuteReader myDropDownList.DataBind() That works alright and a few lines later in the code I wish...
3
by: Stephen Adam | last post by:
Hi there, I'm sure i'm missing something really simple here, all i want to do is get the value of the selected item in a list box. Even after much fiddling about last night I still could not get...
3
by: John Walker | last post by:
Hi, On an ASP.NET page I have a drop down list control. When the user pulls down the list and makes a selection, I perform validation, and if the validation fails I want the selected item in...
1
by: icurfmn8 | last post by:
How do I highlight the row of a table where the row is the selected row? kind of like a drop-down box where the selected item is highlighted, but I need a list. Hurry.
2
by: SunnySnow29 | last post by:
Hi, I have a 2 drop down lists in C# populated with data from a SQL 2005 db. When a new item of data is inserted the second list must update to reflect the change (the first drop down list will...
1
by: bytenut | last post by:
I would like to display two field values in a combo after selecting from the list items... i.e. my drop-down shows two fields from a lookup, but when I select the item, only the first field value is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.