Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partially Bold Text in an HTML select

Tags:

html

css

I'm not sure if this is even possible, but I have a case where I'd like to bold part (not all) of the text within an option of an HTML select tag.

I tried using b tags, as well as strong tags, with no luck (on Chrome). CSS might work, but since it works at the element level, I'm not sure how to go about it that way.

Is there any way to do this?

like image 757
Ben Avatar asked Feb 09 '11 23:02

Ben


People also ask

How do you make half text bold in HTML?

To make text bold in HTML, use the <b>… </b> tag or <strong>… </strong> tag. Both the tags have the same functioning, but <strong> tag adds semantic strong importance to the text.

Which is the right tag for bold in HTML?

Definition and Usage The <b> tag specifies bold text without any extra importance.

How do I select bold font in CSS?

To create a CSS bold text effect, you must use the font-weight property. The font-weight property determines the “weight” of a font, or how bold that font appears. You can use keywords or numeric values to instruct CSS on how bold a piece of text should be.

How do you represent the bold tag element?

The HTML <b> tag merely gives text a bold appearance but does not provide any semantic meaning to the text. This tag is also commonly referred to as the <b> element. TIP: The HTML <b> tag should not be confused with the <strong> tag which gives text a strong emphasis.


2 Answers

No; it's not possible.

Instead, you can make a fake dropdown list using Javascript.

like image 123
SLaks Avatar answered Oct 03 '22 18:10

SLaks


since chrome doesn't allow bold font on option tag . you can use text-shadow property like

text-shadow: 0px 0px 0px black;

it will give same appearance of bold and work on all the browsers

like image 27
Pritesh Avatar answered Oct 03 '22 19:10

Pritesh