gpt4 book ai didi

css - 添加类以选择标签

转载 作者:行者123 更新时间:2023-12-04 08:46:21 26 4
gpt4 key购买 nike

我正在尝试向 select 标记添加一个类,以便下拉菜单可以继承一些 css 样式,但我无法应用该样式。我是否错误地格式化了类(class)?
这是我的代码:

packagesmenu {
box-shadow: none!important;
background: transparent!important;
background-color: transparent!important;
padding: 8px 5px!important;
border-top: 1px solid #AAA!important;
border-left: 1px solid #AAA!important;
border-right: 1px solid #AAA!important;
border-bottom: 1px solid #AAA!important;
max-width: 100%!important;
outline: none;
border-radius: 0;
margin-bottom:15px!important;
text-transform:none!important;
}

packagesmenu:focus {
box-shadow: 0 0 5px 0 #ee2b30!important;
border-top: 1px solid #ee2b30!important ;
border-left: 1px solid #ee2b30!important;
border-right: 1px solid #ee2b30!important;
border-bottom: 1px solid #ee2b30!important;
}
<select style="width:100%;display:block;max-width:600px;margin:0 auto;" onchange="window.location.href = this.value" class="packagesmenu" name="packagesmenu" >
<option>Find your location</option>
<option value="https://go.booker.com/location/vixennailsandspamilton/buy/series">
Milton
</option>
<option value="https://go.booker.com/location/vixennailsandspamississauga/buy/series">
Mississauga</option>
<option value="https://go.booker.com/location/vixennailsandspadanforth/buy/series">
Danforth
</option>
<option value="https://go.booker.com/location/vixenburlington/buy/series">
Burlington
</option>
<option value="https://go.booker.com/location/VixenNailsandSpaOakville/buy/series">
Oakville
</option>
</select>

最佳答案

CSS , class selector是以句号开头的名称 (“.”)和一个 ID selector是以哈希字符开头的名称 (“#”).所以你的类名声明是错误的。

.packagesmenu {
box-shadow: none!important;
background: transparent!important;
background-color: transparent!important;
padding: 8px 5px!important;
border-top: 1px solid #AAA!important;
border-left: 1px solid #AAA!important;
border-right: 1px solid #AAA!important;
border-bottom: 1px solid #AAA!important;
max-width: 100%!important;
outline: none;
border-radius: 0;
margin-bottom:15px!important;
text-transform:none!important;
}

.packagesmenu:focus {
box-shadow: 0 0 5px 0 #ee2b30!important;
border-top: 1px solid #ee2b30!important ;
border-left: 1px solid #ee2b30!important;
border-right: 1px solid #ee2b30!important;
border-bottom: 1px solid #ee2b30!important;
}

关于css - 添加类以选择标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64296483/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com