每当我尝试更改段落的不透明度时,它会更改文本和背景的不透明度,我只想更改文本的背景,我该如何解决?
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)
更改 #introtext 背景颜色的 alpha 值:
background-color: rgba(0, 0, 0, 0.1);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3362 次 |
| 最近记录: |