当前位置: 首页 > article >正文

vue首页多模块布局(标题布局)

在这里插入图片描述

<template>

    <div class="box">

      <div class="content">
        <div class="box1" style="background-color: rgb(245,23,156)">第一个</div>
        <div class="box2" style="background-color: rgb(12,233,3)">第二个</div>
        <div class="box3" style="background-color: rgb(109,5,255)">第三个</div>
        <div class="box4" style="background-color: rgb(233,187,3)">第四个</div>
        <div class="box5" style="background-color: rgb(233,3,34)">第五个</div>
        <div class="box6" style="background-color: rgb(245,23,156)">第六个</div>
        <div class="box7" style="background-color: rgb(3,179,233)">第七个</div>
        <div class="box8" style="background-color: rgb(233,187,3)">第八个</div>
      </div>

    </div>

</template>

<script>
export default {
  components: {//组件

  },
  provide() {
    return {};
  },
  data() {
    return {};
  },
  created() { //创建时

  },
  methods: {}
};
</script>

<style scoped>
  .box{
    height: calc(100% - 40px);
    background-color: red;
    padding: 20px;
  }
  .content{
    width: 100%;
    height: 100%;
    background-color: #fff;

    /*  设置网格布局  */
    display: grid;
    /*  设置列数 每个行岁站的份数  */
    grid-template-columns: repeat(3,1fr);
    /*  设置行数 每个行所占的份数  */
    grid-template-rows: repeat(3,1fr);
    /*  网格间距  */
    gap: 10px;

  }
  /*  跨列  */
  .box7{
    grid-column: span 2;
  }

</style>

在这里插入图片描述

<template>

    <div class="box">

      <div class="content">
        <div class="box0" style="background-color: #409EFF">
          此处未标题
        </div>
        <div class="box1" style="background-color: rgb(245,23,156)">第一个</div>
        <div class="box2" style="background-color: rgb(12,233,3)">第二个</div>
        <div class="box3" style="background-color: rgb(109,5,255)">第三个</div>
        <div class="box4" style="background-color: rgb(233,187,3)">第四个</div>
        <div class="box5" style="background-color: rgb(233,3,34)">第五个</div>
        <div class="box6" style="background-color: rgb(245,23,156)">第六个</div>
        <div class="box7" style="background-color: rgb(3,179,233)">第七个</div>
        <div class="box8" style="background-color: rgb(233,187,3)">第八个</div>
      </div>

    </div>

</template>

<script>
export default {
  components: {//组件

  },
  provide() {
    return {};
  },
  data() {
    return {};
  },
  created() { //创建时

  },
  methods: {}
};
</script>

<style scoped>
  .box{
    height: calc(100% - 40px);
    background-color: red;
    padding: 20px;
  }
  .content{
    width: 100%;
    height: 100%;
    background-color: #fff;

    /*  设置网格布局  */
    display: grid;
    /*  设置列数 每个行岁站的份数  */
    grid-template-columns: repeat(3,1fr);
    /*  设置行数 每个行所占的份数  这种是统一样式固定排列
    grid-template-rows: repeat(3,1fr);*/

    grid-template-rows: 50px 1fr 1fr 1fr;/* 解读: 第一行50px高度 后面默认统一 */


    /*  网格间距  */
    gap: 10px;

  }
  /*  跨列  */
  .box7{
    grid-column: span 2;
  }
  .box0{
    grid-column: span 3;
  }

</style>


http://www.kler.cn/a/105314.html

相关文章:

  • 在Java中使用FileReader.read()进行读取文件时,为什么乱码?两个方法解决
  • ROS学习记录2018.7.10
  • 使用java mail SMTPTransport发送邮箱,本地秒到,一上服务器就20-30s左右,生产环境直接发送失败。
  • Python基础学习004——for循环与字符串
  • 一、Docker Compose——什么是 Docker Compose
  • mongodb-gridfs下载文件报Sort exceeded memory limit of 104857600 bytes异常
  • MSQL系列(七) Mysql实战-SQL语句Join,exists,in的区别
  • 【顺序栈的表示和实现,顺序栈的初始化,是否为空,清空顺序栈,销毁顺序栈,】
  • Nginx的请求时间限制(如周一到周五可以访问)
  • Lua语言编写爬虫程序
  • ExcelPatternTool 开箱即用的Excel工具包现已发布!
  • Delphi 编程实现拖动排序并输出到文档
  • idea免费插件分享
  • 基于FPGA的电风扇控制器verilog,视频/代码
  • centos7安装redis(包含各种报错)
  • JVM常见的垃圾回收器(详细)
  • 【M365运维】给从本地同步到O365的DL添加 Send As权限
  • 用友U8SMSProxy -SQL注入漏洞
  • 疫情集中隔离
  • postgresql|数据库|序列Sequence的创建和管理