css(图片在上方,文字在上方,垂直水平展示)
<div class="son">
<img src="./img/me.png" alt="">
<text class="info">数码产品</text>
</div>
<div class="son">
<img src="./img/me.png" alt="">
<text class="info">数码产品</text>
</div>
<div class="son">
<img src="./img/me.png" alt="">
<text class="info">数码产品</text>
</div>
</div>
项目 | Value | 注释 |
---|
justify-content | space-between | 元素两边留有空隙 |
flex-directio | row | 所有元素放置一行 |
flex-direction | column | 元素垂直显示 |
.dad {
width: 50%;
height: 50%;
justify-content: space-between;
flex-direction: row;
display: flex;
}
.son {
left: 10px;
display: flex;
flex-direction: column;
align-items: center;
}
.son img {
width: 12px;
height: 12px;
}