请帮助我的代码所需。我真的不能让它工作。我花了4个多小时才弄清楚如何扩展背景线性颜色以完全覆盖背景。我有图像和h1
和p
标签,因为您可以在代码中看到只覆盖了一半的图像背景。背景:线性梯度(rgba(255,0,0,0.5))未覆盖整个背景
请让我知道如何解决这个问题。
我错过了什么?
#bottom {
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
background-repeat: repeat;
background-size: cover;
background-position: fixed;
background: linear-gradient(rgba(255, 0, 0, 0.5), rgba(0, 255, 0, 0.5), rgba(0, 0, 255, 0.5));
}
#khalifa {
height: 100%;
width: 50%;
float: left;
}
#bottom h1 {
text-align: center;
text-transform: uppercase;
font-weight: bold;
color: maroon;
}
#bottom p {
text-align: justify;
padding: 20px;
font-size: 18px;
font-family: sans-serif;
}
#bottom img {
width: 100%;
height: 700px;
}
#empire {
width: 50%;
float: left;
}
<div id="bottom">
<div>
<div id="khalifa">
<a href="#">
<img src="images/khalifa.jpg" alt="">
</a>
<h1>Burj-Al-Khalifa</h1>
<p>The Burj Khalifa (Arabic: برج خليفة, Arabic for "Khalifa Tower"; pronounced English /ˈbɜːrdʒ kəˈliːfə/), known as the Burj Dubai before its inauguration, is a megatall skyscraper in Dubai, United Arab Emirates. It is the tallest structure in the
world, standing at 829.8 m (2,722 ft)</p>
</div>
<div id="empire">
<a href="#">
<img src="images/empire.jpg" alt="">
</a>
<h1>Empire State</h1>
<p>The Burj Khalifa (Arabic: برج خليفة, Arabic for "Khalifa Tower"; pronounced English /ˈbɜːrdʒ kəˈliːfə/), known as the Burj Dubai before its inauguration, is a megatall skyscraper in Dubai, United Arab Emirates. It is the tallest structure in the
world, standing at 829.8 m (2,722 ft)</p>
</div>
<div id="royal">
<a href="#">
<img src="images/oneworld.jpg" alt="">
</a>
<h1>Burj-Al-Khalifa</h1>
<p>The Burj Khalifa (Arabic: برج خليفة, Arabic for "Khalifa Tower"; pronounced English /ˈbɜːrdʒ kəˈliːfə/), known as the Burj Dubai before its inauguration, is a megatall skyscraper in Dubai, United Arab Emirates. It is the tallest structure in the
world, standing at 829.8 m (2,722 ft)</p>
</div>
<div id="empire">
<a href="#">
<img src="images/kingdom.jpg" alt="">
</a>
<h1>Empire State</h1>
<p>The Burj Khalifa (Arabic: برج خليفة, Arabic for "Khalifa Tower"; pronounced English /ˈbɜːrdʒ kəˈliːfə/), known as the Burj Dubai before its inauguration, is a megatall skyscraper in Dubai, United Arab Emirates. It is the tallest structure in the
world, standing at 829.8 m (2,722 ft)</p>
</div>
<div id="khalifa">
<a href="#">
<img src="images/chrysler.jpg" alt="">
</a>
<h1>Burj-Al-Khalifa</h1>
<p>The Burj Khalifa (Arabic: برج خليفة, Arabic for "Khalifa Tower"; pronounced English /ˈbɜːrdʒ kəˈliːfə/), known as the Burj Dubai before its inauguration, is a megatall skyscraper in Dubai, United Arab Emirates. It is the tallest structure in the
world, standing at 829.8 m (2,722 ft)</p>
</div>
</div>
</div>