Home>Article>Web Front-end> How to clear background color in css

How to clear background color in css

王林
王林 Original
2021-05-19 14:44:09 6137browse

The way to clear the background color in css is to add the background-color attribute to the background and set the attribute value to transparent, so that the background color is cleared, such as [background-color: transparent].

How to clear background color in css

The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.

If we want to clear the background color, we can use the background-color attribute to make the background color transparent, thereby clearing the background color.

The background-color property sets the background color of the element.

Note:

The background-color property sets a solid color for the element. This color fills the element's content, padding, and border areas, extending to the outer bounds of the element's border (but not the margins). If the border has transparent parts (such as a dotted border), the background color will show through these transparent parts.

Common attribute values:

  • color_name specifies that the color value is the background color of the color name (such as red).

  • hex_number specifies the background color whose color value is a hexadecimal value (such as #ff0000).

  • rgb_number specifies the color value as the background color of the rgb code (such as rgb(255,0,0)).

  • transparent Default. The background color is transparent.

  • #inherit Specifies that the setting of the background-color attribute should be inherited from the parent element.

Code sample:

   

这是标题 1

这是标题 2

这是段落

这个段落设置了内边距。

Related video tutorial:css video tutorial

The above is the detailed content of How to clear background color in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn