下拉列表中的一个选项的粗体部分 [英] Bold part of an option in a drop down list

查看:127
本文介绍了下拉列表中的一个选项的粗体部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以在下拉列表选项中仅粗调文本的一部分,或者这是不可能的?

Is there a way to bold only part of the text in a drop down list option or is this not possible?

我知道你可以设置整个选项与CSS,但这不是我正在寻找。

I know that you can style the entire option with CSS, but that is not what I am looking for. And HTML inside of an option tag does not render.

下面是一个下拉列表项的示例:

Here would be an example of a drop down list item:

SomeID - ID说明

SomeID - Description of ID

推荐答案

最有可能的解决方案,你会发现在那里将添加一个硬编码风格的周围跨度,但IE(7)或Firefox(3.0.12)没有这一点。事实上,如果你看看在Firefox中生成的源,内部跨度是完全剥离。

You cannot do this. The most likely solution you'll find "out there" would be to add a surrounding span with hard coded style, but neither IE (7) nor Firefox (3.0.12) honor this. In fact, if you look at the generated source in Firefox, the internal span is completely stripped out.

你可以做的是使用JavaScript解决方案给你的外观的选择,而不实际使用选择。

What you can do is use a JavaScript solution to give you the appearance of a select without actually using a select.

编辑:这是一个伟大的HOWTO如何做: http://www.devirtuoso.com/2009/08/styling-drop-down-boxes-with- jquery /

And here's a great HOWTO on how to do it: http://www.devirtuoso.com/2009/08/styling-drop-down-boxes-with-jquery/

这篇关于下拉列表中的一个选项的粗体部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆