如何将此Div图像设置为全屏,以使其隐藏蓝色背景颜色
我制作了一个DIV并设置了其背景图像,但背景图像没有覆盖全屏,周围有一些空间。蓝色是身体颜色。
请参考图像在这里
我非常初学者Web开发的初学者,请原谅我的愚蠢错误
#one{
background:linear-gradient(0deg, rgba(0, 0, 0, 0.7) 10% , rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.7) 75%), url("https://picsum.photos/500");
padding-top: 168px;
padding-bottom: 100px;
color: white;
border: none;
background-size: cover;
}
<div id="one">
<center>
<p id="p1">Unlimited movies, TV <br>shows and more.</p>
<p id="p2">Watch anywhere. Cancel anytime.</p>
<p id="p3">Ready to watch? Enter your email to create or restart your membership.</p>
<input id="mail" type="text" >
<input id="mailb" type="submit" value="Get Started">
</center>
</div>
i made a div and set its background image but background image is not covering full screen, theres some space around it. That blue color is body color.
pls refer to image here
i am very beginner to web development pls forgive my silly mistakes
#one{
background:linear-gradient(0deg, rgba(0, 0, 0, 0.7) 10% , rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.7) 75%), url("https://picsum.photos/500");
padding-top: 168px;
padding-bottom: 100px;
color: white;
border: none;
background-size: cover;
}
<div id="one">
<center>
<p id="p1">Unlimited movies, TV <br>shows and more.</p>
<p id="p2">Watch anywhere. Cancel anytime.</p>
<p id="p3">Ready to watch? Enter your email to create or restart your membership.</p>
<input id="mail" type="text" >
<input id="mailb" type="submit" value="Get Started">
</center>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将此线添加到您的CSS
add this line to your CSS
默认情况下,身体有一定余地。因此,您可以通过将保证金和填充为0来删除。
还要将背景图像保持在中间,请在您的#One样式中添加这两行代码。
希望我的答案对您有帮助。
By default, there is some margin in body. So you can remove that by specifying margin and padding as 0.
Also to keep the background image in center, add these two lines of code in your #one style.
I hope my answer helped you.