当前位置:网站首页>探究flex-basis
探究flex-basis
2022-07-28 00:50:00 【imkaifan】
flex-basis属性定义了在分配多余空间之前,项目占据的主轴空间(main size)。
浏览器根据这个属性,计算主轴是否有多余空间。它的默认值为auto,即项目的本来大小。

<!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>Document</title>
<style>
.wrap {
display: flex;
width: 500px;
height: 70px;
border: 1px solid #ccc;
}
.i {
flex-basis: 20px;
width: 150px;
background-color: aqua;
}
.ii {
flex-basis: 50px;
background-color: bisque;
}
.iii {
flex-basis: auto; /*默认值为auto 也就是已项目本来的大小为准*/
width: 100px;
background-color: blueviolet;
}
</style>
</head>
<body>
<div class="wrap">
<div class="i"></div>
<div class="ii"></div>
<div class="iii"></div>
</div>
</body>
</html>

<!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>Document</title>
<style>
.wrap {
display: flex;
flex-direction: column;
width: 40px;
height: 700px;
border: 1px solid #ccc;
}
.i {
flex-basis: 20px;
height: 90px;
width: 150px;
background-color: aqua;
}
.ii {
flex-basis: 50px;
background-color: bisque;
}
.iii {
flex-basis: auto; /*当主轴的方向变换,其实flex-basis 也就是指的是高度了*/
width: 100px;
height: 300px;
background-color: blueviolet;
}
</style>
</head>
<body>
<div class="wrap">
<div class="i"></div>
<div class="ii"></div>
<div class="iii"></div>
</div>
</body>
</html>
边栏推荐
- Data output - dynamic drawing
- Redis设计规范
- 【数据库数据恢复】SQL Server数据库磁盘空间不足的数据恢复案例
- Sample imbalance - entry 0
- 软考 --- 数据库(2)关系模型
- [Star Project] small hat aircraft War (V)
- N32l43x FLASH read \ write \ erase operation summary
- Software testing interview question: what types of software testing are you familiar with?
- focal loss原理及实现
- A letter to the user of qubu drawing bed
猜你喜欢

Product interpretation - Design and distributed expansion of metersphere UI test module

Redis design specification

Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始

Execute add migration migration and report build failed

In it, there is a million talent gap, and the salary rises, but it is not capped

结构伪类选择器—查找单个—查找多个—nth-of-type和伪元素

Unreal ue4.27 switchboard porting engine process

华为APP UI自动化测试岗面试真题,真实面试经历。

Codeforces Round #807 (Div. 2) A-C题解

2022 software testing skills robotframework + selenium library + Jenkins web Keyword Driven Automation practical tutorial
随机推荐
How to evaluate the effectiveness of R & D personnel? Software Engineer reports help you see everyone's contribution
sftp文件/文件夹上传服务器
uniapp 总结篇 (小程序)
Causes and solutions of JS digital accuracy loss
记录一次生产死锁
【Star项目】小帽飞机大战(六)
Appium 点击操作梳理
[Taichi] draw a regular grid in Tai Chi
Software test interview question: please introduce the meaning of various test types in detail?
[Star Project] small hat aircraft War (V)
微信小程序实现动态横向步骤条的两种方式
清除浮动的原因和六种方法(解决浮动飞起影响父元素和全局的问题)
zkrollup学习资料汇总
The principle and implementation of loss function cross entropy
Codeworks round 807 (Div. 2) a-c problem solution
Promise from getting started to mastering (Chapter 3: customize (handwriting) promise)
Redis设计规范
mongodb/mongoTemplate.upsert批量插入更新数据的实现
[website construction] update SSL certificate with acme.sh: change zerossl to letsencrypt
Appium click operation sorting