Home > Article > Web Front-end > How to remove background color in css
The way to remove the background color in css is to add the background-color attribute to the background color and set the attribute value to transparent, such as [background-color:transparent;], transparent means transparent effect.
The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.
In fact, it is very simple for us to remove the background color. We only need to use background-color:transparent;.
Let’s take a look at this property.
The background-color property sets the background color of an element.
Attribute value:
color Specifies the background color. In CSS Color Values it is possible to find a complete list of color values.
transparent Specifies that the background color should be transparent. This is the default
inherit specifies the background color, which should be inherited from the parent element
Code example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> body { background-color:yellow; } h1 { background-color:#00ff00; } p { background-color:rgb(255,0,255); } </style> </head> <body> <h1>这是标题 1</h1> <p>这是一个段落。</p> </body> </html>
You can put Save the above code locally and run it to see the effect.
Related video sharing: css video tutorial
The above is the detailed content of How to remove background color in css. For more information, please follow other related articles on the PHP Chinese website!