解决方案:

 

①两个叠在一起的层

 

②用半透明的png(推荐)

  

背景透明但文字不透明

 

 

 

 

 

 

 

 

支持IE、Firefox、Chrome、Opera

支持所有浏览器
<html> 
<title>透明</title>
<head>
<style>
#container 
{
    color
: #154BA0;
    background
: #ff0000;
    filter
: Alpha(Opacity=10, Style=0);
    opacity
: 0.10;
    position
: absolute;
    height
: 200px;
    width
:500px;
    z-index
:20;
}

#text 
{
    position
: absolute;
    height
: 200px;
    width
:500px;
    text-align
:center;
    z-index
:30;
}
</style>
</head>
<body >
<div id="container"></div>
<div id="text">背景半透明但文字不透明</div>
</body>
</html> 

相关文章:

  • 2021-10-14
  • 2021-12-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-07-18
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案