选择样式不起作用

时间:2018-01-09 12:05:07

标签: html css

<select class="form-control" class="venue-type" onchange="myFunction()">
  <option value="none" id="#hide">Select Venue Type</option>
  <option>Theme Restaurant</option>
  <option>Blah restaurant</option>
  <option>Flana Restaurant</option>
  <option>Woops Restaurant</option>
</select>

这是我的选择列表我想要没有轮廓边框

select venue-type{
    border: 0 !important;
     -moz-appearance: none;
    -webkit-appearance: none;
    appearance:none;
}

所以我使用了这个css类,但它没有用, 它适用于我想编辑特定选择的每个选择

2 个答案:

答案 0 :(得分:0)

您在css中的班级名称之前错过了.

应该是

select.venue-type {
  border: 0!important;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
}

答案 1 :(得分:0)

试试这个:

<强> Demo

select.venue-type{
    border: 0 !important;
     -moz-appearance: none;
    -webkit-appearance: none;
    appearance:none;
}

<强> HTML:

<select class="form-control venue-type"  onchange="myFunction()">
                                                <option value="none" id="#hide" >Select Venue Type</option>
                                                <option>Theme Restaurant</option>
                                                <option>Blah restaurant</option>
                                                <option>Flana Restaurant</option>
                                                <option>Woops Restaurant</option>
                                            </select>