段落中的不透明度更改会更改文本不透明度和背景不透明度

5 html css opacity

每当我尝试更改段落的不透明度时,它会更改文本和背景的不透明度,我只想更改文本的背景,我该如何解决?

HTML

<div id="opener">
 <p id="introText">
  Adam Ginther is a<class id="blueText"> front-end developer</class> with an interest in responsive & mobile design
 </p>
</div>
Run Code Online (Sandbox Code Playgroud)

css

#opener {
        background-image: url('images/background.jpg');
        background-color: #373737;
        height: 800px;
        width: 100%;
        position: fixed;
        }

#introText {
        width: 400px;
        color: white;
        background-color: black;
        text-align: center;
        display: table-cell;
        position: absolute;
        top: 50%;
        left: 50%;
        padding: 50px 80px 50px 80px;
        font-family: 'Fenix', serif;
        font-size: 1em;
           }
#blueText {
        color:#00aeff;
          }
Run Code Online (Sandbox Code Playgroud)

Nik*_*har 3

更改 #introtext 背景颜色的 alpha 值:

background-color: rgba(0, 0, 0, 0.1);
Run Code Online (Sandbox Code Playgroud)