gpt4 book ai didi

css - 如何通过CSS在背景周围添加图片?

转载 作者:行者123 更新时间:2023-11-28 12:59:28 25 4
gpt4 key购买 nike

我真的很努力做这件事,但我不知道如何通过 CSS 创建它。

基本上就此website here我正在尝试将图像添加到主要内容背景之外,如下图所示。哪里写着“最新类(class)”(抱歉打字错误)或哪里写着接收我们的时事通讯。

有人有俱乐部吗?我迷路了!

这是一些代码:

.main-content {
position:relative;
z-index:100;
padding:1em 0 8.5em 0;
background:#fff;
}

.main-content p {
color:#555;
}

.site-wrap {
position:relative;
min-height:100%;
}

enter image description here

最佳答案

我建议做的是在后台创建一个如下所示的 div:

HTML:

<div id="backgrounddiv">
</div>

所以 HTML 真的很简单。不要在这些 div 中放置任何东西。现在是 CSS:

CSS:

    #backgrounddiv {
length:100%; //spans length of page
width:100%; //spans width of page
z-index:1; //makes sure background is behind all the other objects
background-color: #000; //black background
position: absolute; //isn't affected or doesn't get affected by other elements
}

关于css - 如何通过CSS在背景周围添加图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16264875/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com