首页 > 其他分享 >flex布局

flex布局

时间:2023-06-29 12:11:47浏览次数:26  
标签:flex bottom 布局 height wrap calc 30px

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-around;
        }
        .item {
            width: calc(calc(100% / 3) - 10px);
            border: 1px solid blue;
            height: 30px;
            line-height: 30px;
            color: red;
            margin-bottom: 10px;
        } 
        .item:nth-child(n+4) {
            margin-bottom: 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
    </div>
</body>
</html>

 

标签:flex,bottom,布局,height,wrap,calc,30px
From: https://www.cnblogs.com/whlBooK/p/17513888.html

相关文章

  • CSS:Flex布局
    什么是Flex布局任何一个容器都可以指定为Flex布局。.box{display:flex;}基本概念采用Flex布局的元素,称为Flex容器(flexcontainer)容器默认存在两根轴:水平的主轴(mainaxis)和垂直的交叉轴(crossaxis)。主轴的开始位置(与边框的交叉点)叫做mainstart,结束位置叫做main......
  • css grid布局(网格布局)笔记
    Grid布局网格布局的基本概念CSS网格布局引入了二维网格布局系统,可用于布局页面主要的区域布局或小型组件。什么是网格?网格是一组相交的水平线和垂直线,它定义了网格的列和行。我们可以将网格元素放置在与这些行和列相关的位置上。网格布局的特点:固定的轨道尺寸或者弹性......
  • Firebug调试CSS布局
    Firebug与CSS布局  译/raywill  当CSS盒子之间没有正确的对齐的时候,可能很难找到原因。这时候可以用Firebug来测量一下盒子的偏移、外边距(margin)、内边距(padding)以及大小(size)。玩CSS,离不开它!     盒模型阴影在css中,所有元素都适用于盒模型,拥有margin、border、padding和具......
  • 3-布局
    1-示例代码importPySimpleGUIassgsg.theme('GrayGrayGray')layout=[[sg.Text('ThisisLineone')],[sg.Text('ThisisLinetwo')],]#创造窗口window=sg.Window('WindowTitle',layout)事件监......
  • JQ 用最少代码实现瀑布流布局
    <!DOCTYPEhtml><htmllang="zh-cn"><head><metacharset="UTF-8"><title></title><style>html{_background:url(about:blank);}body{background-color:#fff;color:#333;overflow-x:hidden;}body,......
  • CSS实现图片自适应布局,且不拉伸变型
    1.通过背景图的方式处理图片( 通过background-size作用在容器上).img_background{width:300px;height:300px;background-image:url('image.jpg');background-repeat:no-repeat;//是否平铺background-position:centercenter;//设置背景图像的起......
  • [matplotlib] axes 布局
    从high-level方法和low-level方法讲figure上的axes布局。从high-level的角度,我们可以用以下几种方法,直接设置布局:importmatplotlib.pylotasplt#创建2x2的布局#方法1:fig,axes=plt.subplots(nrows=2,ncols=2)#方法2:fig,axes=plt.subplot_mosaic([['upperleft......
  • 什么是 SAP Commerce Cloud 的 Flexible Search?
    SAPCommerceCloud的FlexibleSearch是一种强大而灵活的查询语言和工具,用于在SAPCommerceCloud平台上执行复杂的数据库查询操作。它提供了一种高度可定制的方式来检索和操作存储在CommerceCloud数据库中的数据。FlexibleSearch可以用于在产品、订单、用户等对象之间进行联接、......
  • vue学习第25天 移动WEB开发----响应式布局
    目标:1)响应式原理2)使用媒体查询完成响应式导航3)使用Bootstrap的栅格系统4)使用Bootstrap的响应式工具5)完成阿里百秀首页案例 目录:1)响应式开发2)Bootstrap前端开发框架3)Bootstrap栅格系统4)阿里百秀首页案例  ......
  • Android 线性布局平分宽度item的隐藏问题
    原文:Android线性布局平分宽度item的隐藏问题-Stars-One的杂货小窝一直只使用layout_weight来平分布局,但是如果隐藏了某个item,会导致其他item宽高有所变化于是询问了ChatGpt后,才是了解到LinearLayout的weightSum这个属性的使用需求一行有3个item平分线性布局,宽度都是......