【发布时间】:2022-01-10 09:17:01
【问题描述】:
我尝试过使用text-align 和justify-content,但它们都拒绝工作。我想我在所有间距上都犯了一个错误。
这是 HTML:
.container1 {
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.placeholder {
display: flex;
justify-content: center;
align-items: center;
background-color: #6D747D;
width: 400px;
height: 200px;
}
.contents1 {
display: flex;
margin: 0 auto;
}
<div class="contents1">
<div class="container1">
<h1>This website is awesome</h1>
<p>This website has some subtext that goes hear under the main title. It's a smaller font and the color is lower contrast</p>
<div class="button">Sign up</div>
</div>
<div class="image">
<div class = "placeholder">this is a placeholder for an image</div>
</div>
</div>
【问题讨论】:
-
预期输出是什么?
-
请说出你想要达到的目标