蓝桥杯(Web大学组)2022国赛真题:新鲜的蔬菜

主要是对flex的运用

使用  display: flex;   justify-content: space-between;

以及对其中单个子元素进行操作:align-self: center;   align-self: end;

.container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  width: 960px;
  margin: 0 auto;
}

.item {
  display: block;
  width: 66px;
  height: 66px;
}

.item img {
  width: 100%;
  height: auto;
}

[class$="box"] {
  width: 204px;
  height: 204px;
  margin: 20px;
  background-image: linear-gradient(
    rgb(252, 213, 136) 33.3%,
    #fff493 0,
    #fdf45d 66.6%,
    #f8da47 0
  );
  background-size: 6px 6px;
}

/* TODO:待补充代码 */
[class$="box"]:nth-child(1){
  display: flex;
    justify-content: center;
    align-items: center;
}
[class$="box"]:nth-child(2){
  display: flex;
  justify-content: space-between;
}
[class$="box"]:nth-child(2) span:nth-child(2){
  align-self: end;
}
[class$="box"]:nth-child(3){
  display: flex;
  justify-content: space-between;
}
[class$="box"]:nth-child(3) span:nth-child(2){
  align-self: center;
}
[class$="box"]:nth-child(3) span:nth-child(3){
  align-self: end;
}

相关推荐

  1. Web大学2022新鲜蔬菜

    2024-02-07 14:36:03       52 阅读
  2. web新鲜蔬菜

    2024-02-07 14:36:03       33 阅读
  3. Web大学2022:展开你扇子

    2024-02-07 14:36:03       53 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-07 14:36:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-07 14:36:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-02-07 14:36:03       82 阅读
  4. Python语言-面向对象

    2024-02-07 14:36:03       91 阅读

热门阅读

  1. 51单片机 温度传感器得数据,传到上位机

    2024-02-07 14:36:03       51 阅读
  2. docker学习

    2024-02-07 14:36:03       50 阅读
  3. C++类模板实例:数组类封装

    2024-02-07 14:36:03       46 阅读
  4. Synchronized 和 ReentrantLock 的区别

    2024-02-07 14:36:03       56 阅读
  5. Dockerfile和.gitlab-ci.yml文件模板

    2024-02-07 14:36:03       57 阅读
  6. 什么是可解释AI

    2024-02-07 14:36:03       47 阅读
  7. 详解Non-ASCII character ‘\xe6‘

    2024-02-07 14:36:03       51 阅读
  8. Spring Cloud Netflix Eureka的参数调优

    2024-02-07 14:36:03       44 阅读
  9. 融转通与转融通

    2024-02-07 14:36:03       53 阅读
  10. 数据分析之数据预处理、分析建模、可视化

    2024-02-07 14:36:03       46 阅读
  11. PostgreSQL开启wal日志归档模式

    2024-02-07 14:36:03       41 阅读