我试图让文本出现在包含背景图像的 div 元素之后,但它下面没有出现任何文本。我不确定要添加什么,该段落不存在,并且我已经为“这是一个测试”尝试了多种样式。
<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>
<br>
<div id="bottomOpener">
<p id="awesome">
I'm also 100% awesome
</p>
</div>
<p> This is a test</p>
/* first.css */
body {
background-color: black;
font-family: 'Fenix', serif;
}
#opener {
background-image: url('../images/background.jpg');
background-color: #373737;
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
height: 800px;
width: 100%;
position: fixed;
text-align: center;
}
#introText {
width: 400px;
height: 40px;
margin-left: 200px;
left: 20%;
color: #ececec;
background-color: black;
text-align: center;
position: absolute;
padding: 50px 80px 50px 80px;
font-size: 1.2em;
/* black, 50% opacity */
background-color: rgba(0, 0, 0, .3);
position: absolute;
}
#blueText {
color:#00aeff;
}
#awesome {
color: white;
}
#bottomOpener {
background-color: white;
}
p {
color: green;
}