弹性盒子(display:flex)布局页面

6.24

容器:container 包含 项目:item

主轴交叉轴开始和结束是start和end

容器的属性:justify-content定义了项目在主轴上的对齐方式

.box{
    justify-content:flex-start,flex-end,center,space-between,space-around
}

设置圆角:

border-radius: 8px;

align-items定义项目在交叉轴上如何对齐

.box{
    align-items:flex-start,flex-end,center,baseline,stretch
}

制作圆形(或者圆角):

border-radius:50%;
.item1{
		 height: 40px;
}		
.item2{
    
		height: 40px;
}
.item3{
		height: 40px;
}
简洁写法:
div[class^=item]{
		height:40px;
}

宽度自己调节:flex:1;

posted @ 2026-06-28 00:20  issMa无尽海  阅读(12)  评论(0)    收藏  举报