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?
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.
Definition and Usage The <b> tag specifies bold text without any extra importance.
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.
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.
No; it's not possible.
Instead, you can make a fake dropdown list using Javascript.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With