web蓝桥杯真题:新鲜的蔬菜

 代码:

.box {
  display: flex;
}
#box1 {
  align-items: center;
  justify-content: center;
}

#box2 {
  justify-content: space-between;
}
#box2 .item:nth-child(2) {
  align-self: end;
}

#box3 {
  justify-content: space-between;
}
#box3 .item:nth-child(2) {
  align-self: center;
}
#box3 .item:nth-child(3) {
  align-self: end;
}

知识点:

1.flex布局

align-self控制子项自己在侧轴的排列方式(单个)                //写在子元素里

2.:nth-child(n)

<span>
  <div>1</div>
  <div>2</div>
</span>
div:nth-child(n)        //返回div父元素(span)下第n个div元素,  !!而不是div的子元素

相关推荐

  1. web新鲜蔬菜

    2024-04-11 16:36:05       14 阅读
  2. Web大学组)2022国赛新鲜蔬菜

    2024-04-11 16:36:05       33 阅读
  3. web:展开你扇子

    2024-04-11 16:36:05       19 阅读
  4. web:灯颜色变化

    2024-04-11 16:36:05       22 阅读
  5. web:卡片话标签页

    2024-04-11 16:36:05       20 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-11 16:36:05       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-11 16:36:05       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-11 16:36:05       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-11 16:36:05       20 阅读

热门阅读

  1. Linux系统中安装 RPM 包

    2024-04-11 16:36:05       15 阅读
  2. 服务器的云备份和快照有哪些区别?

    2024-04-11 16:36:05       12 阅读
  3. Web | CSS选择器

    2024-04-11 16:36:05       14 阅读
  4. 头歌-机器学习 第3次实验 DBScan密度聚类方法

    2024-04-11 16:36:05       14 阅读
  5. 数据结构DAY3--栈与队列

    2024-04-11 16:36:05       15 阅读
  6. Objective-C学习笔记(@property,id,instancetype)4.9

    2024-04-11 16:36:05       14 阅读
  7. Unity 安卓将数据保存为json并读取

    2024-04-11 16:36:05       17 阅读
  8. 【代码随想录】day41

    2024-04-11 16:36:05       16 阅读
  9. 蓝桥杯day21刷题日记--接龙序列 动态规划

    2024-04-11 16:36:05       13 阅读
  10. 【Linux】 探索Linux中的cat指令:常用用法一览

    2024-04-11 16:36:05       13 阅读