所以我有一段时间做一些我认为应该如此简单的事情。ASP.NET列表框样式 - 删除边框并添加阴影
我有一个<asp:ListBox />
元素,我想风格,因为我认为默认看起来很可怕,特别是边框。
但是很少有属性在CSS中起作用,最显着的是无法删除边框。
需要注意的是,我需要它在IE8和IE7中工作,而不仅仅是其他更现代的浏览器。
This example site有漂亮的listbox元素,但我无法接近他们的任何地方。
有什么想法?
继承人的HTML:
<asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple" AutoPostBack="true"
onselectedindexchanged="ListBox1_SelectedIndexChanged" CssClass="myListBox" >
<asp:ListItem>ITEM 1</asp:ListItem>
<asp:ListItem>ITEM 2</asp:ListItem>
<asp:ListItem>ITEM 3</asp:ListItem>
<asp:ListItem>ITEM 4</asp:ListItem>
</asp:ListBox>
而CSS:
.myListBox
{
border-style:none;
border-width:0px;
border: none;
font-size:12pt;
font-family:Verdana;
}
谢谢...我更新了这个,虽然它只是在Stack上的一个错字,而不是在我的代码中: – jamis0n
我需要使用什么jQuery元素? – jamis0n
已更新的答案 – MikeSmithDev