Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do you make an item on a drop down list bold?

Posted on 2009-03-30
5
Medium Priority
?
527 Views
Last Modified: 2012-06-21
I have tried using <b> and <em> tags and I still can't get parts of my drop down list to go bold.  Is this possible to do?

<option value="/abc/">Test Page</option>
0
Comment
Question by:Angela123
5 Comments
 
LVL 4

Expert Comment

by:amazingwolf1
ID: 24016967
Hi,
You can't do that in the basic SELECT element.
If you want that functionality, you must implement your own drop down, either in JS or in C#. If you do this with JS I recommend using JQuery which would save you some effort doing that.

Hope this helped!
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 24016999
hello

here you go..
<select SIZE="1" NAME="ListBoxURL">
	<option value="1">One</option>
	<option style="font-weight: bold;" value="2">Two</option>
	<option value="3">Three</option>
	<option value="4">Four</option>
</select>

Open in new window

0
 
LVL 4

Accepted Solution

by:
amazingwolf1 earned 60 total points
ID: 24017041
neeraj523, your example doesnt work.

Angela123 - see MSDN documentation about the option element. It does not have an option to set the font property like you need it:

http://msdn.microsoft.com/en-us/library/ms535877(VS.85).aspx#

So I think my response above gave you a direction where to start.

0
 
LVL 4

Expert Comment

by:KrisTheComputerGuy
ID: 24017261
You change the font styling for the select box as a whole, but styling for individual options ignored. I suggest focusing on why you want certain options bolded and finding a another way to make that happen. For now I'm going to assume the point of bolding is to suggest one or more options as the better choice(s).

One solution could be to simply designate one option as "selected" when the page loads.  

<option selected value="2">Two</option>


Another solution may involve differentiating objects in the select is by adding a unique like symbol (like * &/or **) to the end of the text for the option item. Then place a description for that symbol at the bottom of the page.

<option value="2">Two **</option>

Later...
**<i> Option Two is suggested for such & such reason</i>


Hope that helps

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24018266
The CSS does however work in non-IE browsers
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question