我想用css flex property
(“图像内容”文本中心对齐块,但左对齐)就像下面的图像。如何让文本与块对齐但居中对齐?
但我得到这个
.wrapper {
max-width:300px;
}
.main {
width:300px;
display:flex;
justify-content:center;
align-items:center;
flex-flow:column nowrap;
background:#458bc3;
color:#fff;
height:300px;
overflow:hidden;
}
.content {
color:#fff;
background:#a6d8ff;
height:100px;
display:flex;
justify-content:center;
align-items:center;
flex-flow:column nowrap;
}
.content p {
margin:0px;
}
<div class="wrapper">
<div class="main">
IMAGE
</div>
<div class="content">
<p>
Image
</p>
<p>
Content
</p>
</div>
</div>
我需要(“图像内容”文本对齐与块中心,但左对齐像图像)。 任何人都可以帮助我如何获得这种方法与flex?
哇...它正在工作,因为我期待,非常感谢...... – LKG
您的欢迎:) –