是否可以在 CSS 中更改组合框的设计?
我改变了组合的设计,但是当我在下拉列表中单击它时,滚动条很丑,我可以以某种方式改变他吗?我不使用 JavaScript,只使用 CSS。
这是我的 CSS 和 HTML:
.dropDownList {
background: white;
width: 300px;
line-height: 1;
border: 1px;
border-color: whitesmoke;
border-radius: 4px;
-webkit-appearance: none;
background: url(arrow1.png) no-repeat right #fff;
border-style: outset;
padding: 2px 0;
}
<select onchange="document.location.href = "/pepa/index.php?r=WppActs/create&idp=1830&ida=1&idg=11&idpod=-1&result=arhiva&idgod="+this.value+"&idbroja=-1&idar=-1&idgr=-1&idvs=-1&ids=-1&idpo=-1&idpm=-1&idakta=-1"" class="dropDownList" name="ID" id="ID">
<option value="">Година</option>
<option value="97">1945</option>
<option value="163">1946</option>
<option value="224">1947</option>
<option value="283">1948</option>
<option value="339">1949</option>
<option value="375">1950</option>
<option value="414">1951</option>
<option value="452">1952</option>
<option value="499">1953</option>
<option value="565">1954</option>
<option value="9974">1955</option>
<!-- lots more options -->
</select>
用于生成列表的 PHP 是:
<?php
$m = OgNumbers::model()->getYear();
$list = CHtml::listData($m, 'ID', 'og_year');
$select = $idGodine;
echo CHtml::dropDownList('ID', $select, $list, array('empty' => 'Година','onchange' => 'document.location.href = "/pepa/index.php?r=WppActs/create&idp='.$idPaketa.'&ida='.$idOblast.'&idg='.$idGrupa.'&idpod='.$idPodgrupe.'&result='.$result.'&idgod="+this.value+"&idbroja='.$idBroja.'&idar='.$idaRegistra.'&idgr='.$idgRegistra.'&idvs='.$idVrstaSuda.'&ids='.$idSuda'"','class'=>'dropDownList','size'=>5));
<?php>