#1 2008-01-16 10:07:37
- MrStitch
- Member

- Registered: 2006-10-24
- Posts: 1079
- I've been thanked 12 times.
-

Bolding Form Items
I'm creating a standard form (drop down list) that has a TON of items. I can put these items in sections like Widget Type 1, Widget Type 2, etc...
I'd like to bold the 'Widget Type 1' (and two and so forth), so that when the user is scrolling down the list of options, they can plainly see where one 'section' ends and another section begins.
Is that possible? I tried adding the <b> tag to the corresponding drop-down options, but that didn't do anything.
Offline
#2 2008-01-16 10:22:09
- ColoEagle
- Administrator

- From: Colorado, USA
- Registered: 2006-02-15
- Posts: 2111
- I've been thanked 83 times.
-

Re: Bolding Form Items
How about adding a class to the option tag, or use inline css? Of course setting a class in the css stylesheet would be best.
Code: html
<option class="bold">Widget One</option>
<option style="font-weight:bold;">Widget One</option>
The only way to discover the limits of the possible is to go beyond them into the impossible
Attention designers and webmasters - "The Beauty of CSS"
Valid Web Designs tutorials on HTML, XHTML and CSS
Home Security Systems
Offline
#3 2008-01-16 10:47:47
- MrStitch
- Member

- Registered: 2006-10-24
- Posts: 1079
- I've been thanked 12 times.
-

Re: Bolding Form Items
CE - What would I ever do without you..... Works great! 
Offline
#4 2008-01-16 11:34:57
- Steven_A_S
- Member

- From: San Antonio, TX
- Registered: 2006-08-07
- Posts: 443
- I've been thanked 21 times.
-
Re: Bolding Form Items
Another option if your widget 1 and widget 2 are non selectable group titles would be to use the <optgroup> tag like this:
Code: html
<select name="Widgets">
<optgroup label="Widget 1">
<option value="wgt1a">Widget 1a</option>
<option value="wgt1b">Widget 1b</option>
</optgroup>
...
</select>
Then you should be able to format the optgroup directly, but try without first, cause I think it defaults to bold as well as starts the label more to the left than the option does.
Offline
#5 2008-01-21 01:57:31
- Ryan_steyn
- Member

- From: South Africa, Port Elizabeth
- Registered: 2006-08-23
- Posts: 1673
- I've been thanked 26 times.
-
Re: Bolding Form Items
Thats quite cool, i always thought that was a javascript/jedi mind trick, does it validate though? how come its not in the general tutorials?
Lalibela Game Reserve in malaria free South Africa
"Humans are by far the most fascinating creatures, in a universe with no boundaries and a world with so much unfound wonder we are the only entities capable of creating boredom"
Offline
#6 2008-01-21 09:59:21
- Steven_A_S
- Member

- From: San Antonio, TX
- Registered: 2006-08-07
- Posts: 443
- I've been thanked 21 times.
-
Re: Bolding Form Items
I've never had a need to use it, but I just tested it and it validated fine.
Last edited by Steven_A_S (2008-01-21 10:00:32)
Offline
#7 2008-01-21 18:44:44
- MrStitch
- Member

- Registered: 2006-10-24
- Posts: 1079
- I've been thanked 12 times.
-

Re: Bolding Form Items
So far, I think I'm sticking to the inline. It's really not that much code. Threw in some more styles and it's looking pretty good.
Thanks for the suggestions!
Offline
| Never |
- Sponsored Results
|
|