CSS样式优先顺序

问题描述

我认为更具体的样式应优先考虑?我有以下似乎没有遵循这些规则的代码:

<style type="text/css">

    * {
        box-sizing: border-box; 
        font-family: Ubuntu,Helvetica,Arial,sans-serif; 
        color: red;
        text-align: center;
    }

div{
        font-size: 11px; 
        line-height: 1.5; 
        text-align: center; 
}

#innerRequestSuccessful{
        background-color: #009C00; 
        margin: auto; 
        width: 80%;
        color: #08c7f7;
        text-align: center;
        font-size: 24px;
        font-weight: bold;
}
</style>

<div id="requestSuccessful" style="display: block"> 
    <div id="innerRequestSuccessful">
        <h3>Successfully Added!</h3>
    </div>
</div>

我认为,因为id比*标签更具体,所以它具有优先权。但是<div id="innerRequestSuccessful">中的文本颜色显示为红色,即使内联样式也不显示指定的颜色。 我想念什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...