Home >Web Front-end >CSS Tutorial >Is \'background-color: none\' a Valid CSS Property?
Validity of "background-color:none" in CSS
In CSS, the background-color property defines the background color of an element. Some developers may find themselves wondering if the value "none" is a valid option for this property.
Answer
Despite its intuitive appeal, "none" is not a valid value for background-color. According to the CSS 2.1 specification, the property takes one of the following values:
Therefore, if you intend to make an element's background transparent, you should use the transparent keyword instead of "none."
The above is the detailed content of Is \'background-color: none\' a Valid CSS Property?. For more information, please follow other related articles on the PHP Chinese website!