【发布时间】:2017-06-28 22:24:43
【问题描述】:
我的 h1 标题没有显示在我创建的背景上方我不知道它为什么会发生。 https://jsfiddle.net/b6gezctv/ 这是一个 jsfiddle,因此您将能够运行代码并查看它是否得到修复。
<!DOCTYPE html>
</html>
<head>
<title>Coming Soon</title>
<link rel="stylesheet" type="text/css" href="soon.css">
<link href="https://fonts.googleapis.com/css?family=Roboto"
rel="stylesheet">
</head>
<body>
<div class="heading">
<h1>COMING SOON</h1>
<hr>
</div>
<div class="start-1"></div>
<div class="start-2"></div>
<div class="start-3"></div>
</body>
h1 {
text-align: center;
color: white;
}
.start-1 {
position: absolute;
background-color: #202b36;
width: 100%;
height: 100%;
z-index: 0;
left: 0;
top: 0;
min-width: 950px;
}
.start-2 {
position: absolute;
left: 0;
top: 0;
background-image: url(https://server.pro/s/img/bg-pattern.png);
background-color: transparent;
background-repeat: repeat;
width: 100%;
height: 100%;
opacity: 0.07;
z-index: 1;
min-width: 950px;
}
.start-3 {
position: absolute;
left: 0;
top: 0;
background-image:
url(https://farm3.staticflickr.com/2821/33503322524_4e67143f45_k.jpg);
background-color: transparent;
background-size: cover;
width: 100%;
height: 100%;
z-index: 2;
opacity: 0.5;
min-width: 950px;
}
【问题讨论】:
-
不是问题的原因,但您在开始标记之后还有一个结束 HTML 标记。
标签: css