如何做下拉框,如“更多操作”在Gmail中 [英] How to do drop-down box like "More action" in gmail

查看:291
本文介绍了如何做下拉框,如“更多操作”在Gmail中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Gmail收件箱页面中看到更多操作下拉框。
它在列表中有级别和一些禁用项。

I see the "More Action" drop-down box in gmail inbox page. It has levels and some disabled item in the list.

如何在HTML + CSS中执行此操作?

How to do that in HTML+CSS?

谢谢

推荐答案

您可以分组和停用HTML < select& 元素,而不诉诸使用JavaScript。类似以下内容应该工作:

You can group and disable elements in an HTML <select> element without resorting to the use of JavaScript. Something like the following should work:

<select name="foo">
    <optgroup label="Odds">
        <option value="1">1</option>
        <option value="3">3</option>
        <option value="5">5</option>
    </optgroup>
    <optgroup label="Evens">
        <option value="2">2</option>
        <option value="4">4</option>
        <option value="6" disabled="disabled">6</option>
    </optgroup>
</select>

Firebug中的一个简短检查显示,Google正在伪装他们的下拉框,和一些聪明的CSS。就个人而言,我认为采取正确的方法,并使其风格看起来更漂亮,比重新创造这里更好。

A brief inspection in Firebug shows that Google are faking their drop-down box with a whole bunch of HTML and some clever CSS. Personally, I think taking the "correct" approach and styling it to look prettier is a lot more readable than reinventing the wheel here.

这篇关于如何做下拉框,如“更多操作”在Gmail中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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