gpt4 book ai didi

html - 故意使两个柔性容器在相同的特定位置重叠

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

我需要使“flex-container > div4”与“flex-container > div2”垂直重叠和/或水平对齐。

需要 div2 和 div4 完美居中。

我使用文本对齐使 div2 居中,但 div4 是图像。

.flex-container {
display: flex;
flex-wrap: wrap;
background-color: blue;
}

.flex-container > div {
background-color: #ffffff;
margin-top: auto;
margin-right: auto;
flex-shrink: 0;
height: 35px;
min-width: 150px;
max-width: 150px;
text-align: left;
line-height: 50px;
font-size: 30px;
}
.flex-container > div2 {
background-color: #ffffff;
flex-shrink: 0;
margin-top: auto;
height: 50px;
width: 250px;
text-align: center;
line-height: 50px;
font-size: 12px;
}
.flex-container > div3 {
margin-top: auto;
margin-left: auto;
width: 150px;
height: 35px;
text-align: center;
line-height: 50px;
font-size: 15px;
position: -webkit-sticky;
position: sticky;
top: 0;
align-self: flex-start;
background-color: white;
}
.flex-container > divspacer {
background-color: #ffffff;
width: 33%;
height: 35px;
margin: 1px;
text-align: center;
line-height: 50px;
font-size: 12px;
}
.flex-container > div4 {
margin-left: auto;
background-color: #ffffff;
text-align: center;
}
<div class="flex-container">

<div><img src="https://oakandrocks.com/wp-content/uploads/2019/04/perfootersmol.png"></div>
<div2>
<a class="inline" style="text-decoration: none" href="https://oakandrocks.com/onr"> Webmasters |</a>
<a class="inline" style="text-decoration: none" href="https://oakandrocks.com/terms"> Terms & Conditions | </a>
<a class="inline" style="text-decoration: none" href="https://oakandrocks.com/privacy"> Privacy Policy </a>
</div2>
<div3><a style="text-decoration: none" href="https://oakandrocks.com/">© 2019 Oak & Rocks</a></div3>
</div>
<div class="flex-container"><div4><img src="https://oakandrocks.com/wp-content/uploads/2019/04/footertxt.png"></div4></div>

因此,总而言之,也许不是重叠,但我需要 div4(网站解决方案 png)完美居中并位于页面底部(可能 ~1px 垂直边距)

已修复:

.flexcontainer > div4 {
display: block;
margin-left: auto;
margin-right: auto;
}

最佳答案

像往常一样,在发布问题后,我立即想出了解决办法。

添加:

.flexcontainer > div4 {
display: block;
margin-left: auto;
margin-right: auto;
}

关于html - 故意使两个柔性容器在相同的特定位置重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55861246/

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