demo:
use HTML tag optgroup, view detail please google the item "optgroup"
<style text="text/css">
optgroup { background-color:#eee; color:444; }
</style>
<select>
<option value="">blog.never-online.net</option>
<optgroup label="unselectable"></optgroup>
<option value="">blog.youkuaiyun.com/blueDestiny</option>
<option value="">never-online.cnblogs.com</option>
</select>
use HTML tag optgroup, view detail please google the item "optgroup"
<style text="text/css">
optgroup { background-color:#eee; color:444; }
</style>
<select>
<option value="">blog.never-online.net</option>
<optgroup label="unselectable"></optgroup>
<option value="">blog.youkuaiyun.com/blueDestiny</option>
<option value="">never-online.cnblogs.com</option>
</select>
本文介绍了如何使用HTML中的optgroup元素来组织select下拉菜单中的选项。通过设置optgroup标签的label属性,可以为一组相关的选项创建标题,使得下拉菜单更加清晰易读。本文通过示例代码展示了optgroup的基本用法。
7506

被折叠的 条评论
为什么被折叠?



