语义UI - 为什么表单中没有消息?

Mas*_*r_T 5 html css forms semantic-ui

我使用Semantic-UI,我试图警告添加message到我的Form,就像这样:

<form>
    ...stuff...
    <div class="ui warning message">
        <div class="header">
            Title of the message
        </div>
        Text of the message
    </div>
</form>
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,它在页面上根本没有显示出来.只有在我发现这是因为SemanticUI自己的内部CSS规则明确地隐藏了表单内的消息.来自semantic.min.css:

.ui.form .error.message, .ui.form .success.message, .ui.form .warning.message {
    display: none;
}
Run Code Online (Sandbox Code Playgroud)

为什么是这样?我可以覆盖它吗?我不应该这样做吗?

Mas*_*r_T 8

好吧,我不是100%肯定,但我的是error/ success/ warning类用于表单验证的消息,因此,它们默认是隐藏的原因.我通过使用特定的颜色类而不是warning一个颜色类解决了这个问题:

<form>
    ...stuff...
    <div class="ui yellow message">
        <div class="header">
            Title of the message
        </div>
        Text of the message
    </div>
</form>
Run Code Online (Sandbox Code Playgroud)

这完美地工作,并且在视觉上与warning一个无法区分.