css(图片在上方,文字在上方,垂直水平展示)

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;
		}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_62496369/article/details/127160087