How to set transparent background in css

coldplay.xixi
Release: 2023-01-03 09:30:02
Original
12428 people have browsed it

How to set a transparent background in css: first get the desired color value; then convert the RBG value into a numerical value; finally set the value to css and set the transparency. The code is [background-color:rgba (220,38,38,0.2);}].

How to set transparent background in css

The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.

How to set a transparent background in css:

1. Get the color value you want.

How to set transparent background in css

2. Convert the RBG value into a numerical value, that is, convert a hexadecimal value into a decimal number

   dc = 220  
   26 = 38
   26 = 38
Copy after login

3. Set the value to css, And set the transparency

.title_div{width: 100%;
height: 30px; 
line-height: 30px;
text-align: center;
color:white; 
background-color:rgba(220,38,38,0.2);}
<div class="title_div">
    设备初始化设置
    </div>
Copy after login

4, the effect will come out

How to set transparent background in css

##Related learning recommendations:

css tutorial

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template