Is background-color:none valid CSS?

前端 未结 7 2429
独厮守ぢ
独厮守ぢ 2020-11-28 19:04

Can anyone tell me if the following CSS is valid?

.class {
    background-color:none;
}
7条回答
  •  鱼传尺愫
    2020-11-28 19:41

    The answer is no.

    Incorrect

    .class {
        background-color: none; /* do not do this */
    }
    

    Correct

    .class {
        background-color: transparent;
    }
    

    background-color: transparent accomplishes the same thing what you wanted to do with background-color: none.

提交回复
热议问题