从 ASP.NET DataList 中删除边框折叠样式
我是 ASP.NET 的新手,在设计 DataList 样式时遇到问题。我最近迷上了边框上的圆角,并尝试通过将其应用于所有 HTML 标签来在我的所有页面上使用该效果。在 Internet Explorer 上,我的 DataList 上的边框看起来很糟糕,因为我看到 圆角围绕我的 DataList 的每个元素,而不仅仅是外框边框的四个角。
我追踪到这一事实是 ASP.NET 将:添加
style="collapse-border:collapse"
到呈现的 HTML 中以 DataList 开头的标记中。如果不存在此样式规则,则边框看起来完全按照我的预期< /a>.
我不知道如何消除 ASP.NET 生成的边框折叠样式。我在 Visual Web Developer IDE 或 DataList 的属性中没有看到它。我似乎也无法在样式表中覆盖它。标签上的样式属性是否胜过所有其他规则?谁能建议我如何让 ASP.NET 不生成边框折叠样式?
I'm a newbie at ASP.NET and am having trouble styling a DataList. I've lately become enamored with rounded corners on borders and am trying to use the effect on all of my pages by applying it to all HTML tags. On Internet Explorer, the border on my DataList looks terrible because I see rounded corners around each element of my DataList rather than just the four corners of the outer box border.
I tracked this down to the fact that ASP.NET is adding:
style="collapse-border:collapse"
to the tag that begins my DataList in the rendered HTML. If this style rule is not present, the border looks exactly as I intended.
I don't know how to eliminate the border-collapse style from what ASP.NET generates. I don't see it present in the Visual Web Developer IDE or in the properties for the DataList. I can't seem to override it in a style sheet either. Does the style attribute on a tag trump all other rules? Can anyone suggest how I can get ASP.NET to not generate the border-collapse style?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当
CellSpacing
属性设置为 0(默认值)时,DataList
呈现border-collapse:collapse;
样式。要删除样式,请将CellSpacing
设置为-1
。A
DataList
renders theborder-collapse: collapse;
style when itsCellSpacing
property is set to 0 (the default). To remove the style, setCellSpacing
to-1
.尝试在设计中将 borderstyle 设置为 none 或
try setting borderstyle to none in design or