CSS类属性不会覆盖ASP

塞尔雷克·约翰(SelrekJohn)

我遇到一个问题,无法获取Redgex的摘要来格式化所需的格式。

我将css类与redgex摘要放在相同的aspx文件中,并将其标记为重要。但是,当我运行它时,它仍然没有被使用。

更新

在Chrome的inspect元素中,redgex摘要样式为红色。HedderText显示为红色,似乎是列表项没有跟上,但我不知道为什么它们没有覆盖默认值。

有任何想法吗?

Chrome显示它没有被使用,但不知道为什么:

在此处输入图片说明

CSS:

        .valError {
        color:red !important;
    }

    .validation_summary {
        color:red !important;
    }

ASP Redgex摘要:

<asp:ValidationSummary ID="ValidationSummary1" 
runat="server" 
ShowMessageBox="false" 
ShowSummary="true" 
ValidationGroup="v1" 
ForeColor="Red" 
DisplayMode="BulletList" 
CssClass="valError" 
HeaderText="<span>The below requires attention.</span>"/>
詹尼斯·格里瓦斯(Giannis Grivas)

没有应用任何样式,ValidationSummary呈现为带有错误消息的无聊列表。

但是,使用CSS进行修饰很容易,因为它只不过是内部具有无序列表的div而已,因此您必须在示例和类中进行定义.valError ul

让我们看一个例子:

<asp:ValidationSummary runat="server" 
    DisplayMode="BulletList" 
    CssClass="valError" />

接下来,将其放在带有红色边框的框中

.valError{
 border: 2px solid red;
 color: red;
 margin: 5px 0px;
 padding: 15px;
}

假设我们要在错误列表上填充和边距,然后将其移至右侧

.valError ul {
 margin: 0;
 padding: 0;
 margin-left: 80px;
 list-style: square;
}

希望这可以帮助!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章