批改状态:合格
老师批语:
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>flex容器和项目中常用的属性</title><style>.rq{/* .rq转为flex容器 */background-color: aqua;display: flex;height: 500px;width: 500px;flex-flow: row wrap;/* --------------------------------- *//* 主轴方向 *//* flex-direction:row; 正向排列 默认 *//* flex-direction:row-reverse; 反向排列 *//* flex-direction:column; 主轴改为垂直方向 *//* flex-flow: row wrap; row/row-reverse 正向或者反向 wrap允许换行转为多行容器/nowrap *//* ------------------------------- *//* 项目主轴对齐方式 *//* 项目 主轴居中 */justify-content: center;/* 项目 主轴靠尾部 *//* justify-content: flex-end; *//* 项目 主轴靠起始点 *//* justify-content: flex-start; *//* --------------------------- *//* 分配项目的剩余空间 *//* justify-content: space-around; 分散对齐 *//* justify-content: space-between; 两端对齐 *//* justify-content: space-evenly; 平行对齐 *//* ------------------------------------- *//* 交叉轴对齐方式 *//* align-items:stretch; 拉伸对齐 *//* align-items:flex-start; 上端对齐 *//* align-items:flex-end; 下端对齐 *//* align-items:center; 居中对齐 */}/* flex项目属性 */.rq div {/* 项目 宽度设置 */flex-basis: 50px;/* flex: 放大因子 收缩因子 宽度自动 0为禁止 1为允许 auto自动 或者 固定值 */flex:1 1 auto;}.rq .a{/* 单独设置某个项目交叉轴的属性 */align-self:center;}</style></head><body><div class="rq"><div class="a"><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div><div><p>亲爱的祖国</p></div></div></body></html>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号