CSS 选择器

2022-01-10 00:00:00 css-selectors html css

选择按钮效果很好:

input[type="submit"]
{
    background:#efefef;
    width:auto;
    padding:5px;
    color:#666;
    font-size:16px;
    font-weight:bold;
    padding:5px 15px;
}

但我似乎无法为下拉框找到任何东西,这不起作用:

But I can't seem to get anything to work for drop down boxes, this doesn't work:

input[type="select"]
{
    background:#000;
}

我选对了吗?你可以这样做吗?

Am I selecting it correctly? Can you do it this way?

推荐答案

试试这个:

select {
    background:#000;
}

据我所知,没有 <input type="select"/>,只有 <select></select>.

As I know, there is no <input type="select" />, just <select></select>.

相关文章