更改焦点上的asp lixt框的颜色

问题描述 投票:0回答:1

当用户专注于CSS时如何更改ASP list box的颜色。在我的文本框中,我使用了以下样式,但不适用于ListBox。

.form-control:focus {
    border-color: #66afe9;
    outline: 0;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

.form-control::-moz-placeholder {
    color: #999;
    opacity: 1;
}

.form-control:-ms-input-placeholder {
    color: #999;
}

.form-control::-webkit-input-placeholder {
    color: #999;
}

当用户关注ASP列表框时如何更改列表框的颜色?

<asp:ListBox ID="lstFlat" runat="server" SelectionMode="Single" class="js-example-basic-single form-control">
    <asp:ListItem Text="single room" Value="1" />
    <asp:ListItem Text="double rooms multi storey" Value="2" />
</asp:ListBox>
jquery asp.net jquery-select2
1个回答
0
投票

[当您提供它自己的类时,它将起作用,例如StyledListBox

<asp:ListBox class="js-example-basic-single form-control StyledListBox">

然后是一些CSS

.StyledListBox:focus {
    border: 2px solid red;
    background-color: lightgreen;
    outline: 0 none !important;
    box-shadow: none !important;
}
© www.soinside.com 2019 - 2024. All rights reserved.