0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ASP.NET: DropDownListのスタイル変更

Posted at

##SAMPLE
未選択
image.png

選択
image.png

REFERENCE

出典不明

html

<div>
    <asp:DropDownList ID="List1" runat="server" Width="200px" Height="100px" BackColor="#080808" ForeColor="#ffffff" Font-Names="Andalus" CssClass="ddl" Font-Size="30px" AutoPostBack="True" >
    <asp:ListItem Value="">MENU1</asp:ListItem>
    <asp:ListItem Text="ITEM1"></asp:ListItem>
    <asp:ListItem Text="ITEM2"></asp:ListItem>
    <asp:ListItem Text="ITEM3"></asp:ListItem>
    </asp:DropDownList>
    <asp:DropDownList ID="List2" runat="server" Width="200px" Height="100px" BackColor="#080808" ForeColor="#ffffff" Font-Names="Andalus" CssClass="ddl" Font-Size="30px" AutoPostBack="True" >
    <asp:ListItem Value="">MENU2 </asp:ListItem>
    <asp:ListItem Text="ITEM1"></asp:ListItem>
    <asp:ListItem Text="ITEM2"></asp:ListItem>
    <asp:ListItem Text="ITEM3"></asp:ListItem>
    </asp:DropDownList>
    <asp:DropDownList ID="List3" runat="server" Width="200px" Height="100px" BackColor="#080808" ForeColor="#ffffff" Font-Names="Andalus" CssClass="ddl" Font-Size="30px" AutoPostBack="True" >
    <asp:ListItem Value="">MENU3 </asp:ListItem>
    <asp:ListItem Text="ITEM1"></asp:ListItem>
    <asp:ListItem Text="ITEM2"></asp:ListItem>
    <asp:ListItem Text="ITEM3"></asp:ListItem>
    </asp:DropDownList>
</div>

css

.ddl
{
    text-align: center;
    border:2px solid #7d6754;
    border-radius:5px;
    padding:10px;
    -webkit-appearance: none; 
/*    background-image:url('Images/任意のファイル');*/
    background-position:88px;
    background-repeat:no-repeat;
    text-indent: 0.01px;
    text-overflow: '';
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?