我建立了以下网站:
我正在尝试将“ Gold Plan”白色CSS框居中,以使其恰好适合“ Our Package”标题下。
需要为白框编辑的CSS代码是:
.investment_plans{
height: 100%;
background-position: center 0;
background-size: cover;
position: relative;
padding-top: 100px;
padding-bottom:120px;
}
我已经玩了几个小时了,无法找到使盒子居中的方法。
任何帮助将不胜感激。
欢呼声。
如果要使用CSS将div居中,您可以尝试下面的代码将div居中在屏幕中间
.investment_plans{
height: 100%;
background-position: center 0;
background-size: cover;
position: relative;
padding-top: 100px;
padding-bottom:120px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
}