我正在尝试将“登录”文本放置在距父Card-Header-Background高度33%的位置,但看起来该高度已应用于整个卡。
.Account-Details-Card-Background {
width: 780px;
height: 600px;
border-radius: 18px;
box-shadow: 0 7px 70px 0 rgba(90, 97, 105, 0.1), 0 10px 10px 0 rgba(90, 97, 105, 0.06), 0 4px 8px 0 rgba(90, 97, 105, 0.12), 0 2px 0 0 rgba(90, 97, 105, 0.11);
background-color: #ffffff;
}
.Card-Header-Background {
width: 780px;
height: 69.6px;
border-radius: 18px;
box-shadow: 0 1px 0 0 #e0e2e8, 0 -1px 0 0 #e0e2e8;
background-color: #ffffff;
}
.Label---Log-in {
width: 61px;
height: 24px;
font-family: SFProText;
font-size: 20px;
font-weight: 500;
font-style: normal;
font-stretch: normal;
line-height: normal;
letter-spacing: -0.5px;
text-align: center;
color: #3c5071;
}
<div class="Account-Details-Card-Background" style="margin: 17.6vh 22.9vw; position: absolute">
<div class="Card-Header-Background">
<div>
<div class="Label---Log-in text" style="margin: 33% 45%; position: absolute;">
Log in
</div>
</div>
</div>
</div>
(codepen)
答案 0 :(得分:0)
答案 1 :(得分:0)
现在看来很明显,但是我需要的是填充而不是边距。