用于选择选项的 CSS 为透明背景 [英] CSS for Select Option to be transparent background

查看:40
本文介绍了用于选择选项的 CSS 为透明背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含背景图像的网页.之后,有一个用于过滤某些内容的组合框.我想创建这个选择 - 选项背景是透明的.我在 google 上阅读了很多结果以在 CSS 中使用 select 选项,但它没有用.我在这里创建了一个小提琴:http://jsfiddle.net/25CQE/5 例如 如您所见,选项背景不透明.那么,知道如何解决这个问题吗?还是 CSS 做不到?

I have a web page that have background-image in it. After that, there's a combo box for filtering some content. I want to create this select - option background being transparent. I've read many result at google to use select option at CSS, but it didn't work. I've create a fiddle in here : http://jsfiddle.net/25CQE/5 For example and as You can see, the option background is not transparent. So, any idea how to solve that? Or it cannot be done by CSS?

抱歉我的英语不好

推荐答案

如果你想让它完全透明,不如使用

If you want to make it fully transparent, than use

select {
    border: 1px solid #fff;
    background-color: transparent;
}

演示

如果你想要半透明的背景颜色,那么你可以使用 rgba() 其中 a 代表 alpha

If you are looking to have semi-transparent background color, than you can use rgba() where a stands for alpha

select {
    border: 1px solid #fff;
    background-color: rgba(255,255,255,.5);
    padding: 5px;
}

演示 2

这篇关于用于选择选项的 CSS 为透明背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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