如何将 ASP.NET 列表框边框从 3d 更改为 1px 实心?

发布于 2024-07-26 21:49:44 字数 104 浏览 1 评论 0原文

默认情况下,ASP.NET 中的列表框具有 3D 边框效果。 我需要将其更改为 Solid、1 px、某种颜色。 这可以使用 css 来完成吗?

谢谢, 阿图尔

By default the listbox in ASP.NET has a 3D border effect. I need to change that to Solid, 1 px, some color. Can this be done using css?

Thanks,
Atul

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

酒儿 2024-08-02 21:49:44

我认为对于 ie,选择标签的某些属性不可设置样式。 与与操作系统相关的渲染有关。 不确定ie8。

这是边框样式的内容,但它涉及:

http://v2.easy-designs。网/文章/replaceSelect/

I think that for ie, certain properties of the select tag are not styleable. Something to do with the rendering of it tied to the OS. Not sure about ie8.

Here is something that styles borders, but its involved:

http://v2.easy-designs.net/articles/replaceSelect/

晨敛清荷 2024-08-02 21:49:44

您可以为 ListBox 控件提供一个 CSS 类,然后使用它来定义样式表中您喜欢的边框。

<asp:ListBox id="YourListBox" CssClass="SomeClassName" rows="3" runat="server" />

You can give your ListBox control a CSS class and then use that to define the border you like in your stylesheet.

<asp:ListBox id="YourListBox" CssClass="SomeClassName" rows="3" runat="server" />
川水往事 2024-08-02 21:49:44

或者您可以使用 Asp.net 主题和皮肤

Or you can use Asp.net Themes and Skins

尸血腥色 2024-08-02 21:49:44

对于边框,您可以使用 div 作为列表框的父级:

CSS

.myborder {border: 1px solid blue;}

MARKUP

<div id="contents" runat="server" class="myborder">
  <asp:ListBox ID="lbxItems" runat="server"></asp:ListBox>
</div>

注意:此解决方案仅适用于 IE8+,不适用于 IE7。

For the border you can use a div as list box's parent:

CSS

.myborder {border: 1px solid blue;}

MARKUP

<div id="contents" runat="server" class="myborder">
  <asp:ListBox ID="lbxItems" runat="server"></asp:ListBox>
</div>

Note: This solution only works for IE8+, not IE7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文