当前位置:网站首页>探究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>
边栏推荐
- Completely delete MySQL in Linux system
- Principle and implementation of focal loss
- Redis设计规范
- Promise from introduction to mastery (Chapter 2 understanding and use of promise)
- Fiddler mobile packet capturing agent settings (for Huawei glory 60s)
- 结构伪类选择器—查找单个—查找多个—nth-of-type和伪元素
- Synchronized details
- Use of classes in typescript
- CeresDAO:Ventures DAO的“新代言”
- 微信小程序图片根据屏幕比例缩放
猜你喜欢
![Likeshop takeout ordering system [100% open source, no encryption]](/img/e6/a73aa817b5b30339d755aa53708072.png)
Likeshop takeout ordering system [100% open source, no encryption]

执行 Add-Migration 迁移时报 Build failed.

Netease cloud copywriting

Huawei app UI automation test post interview real questions, real interview experience.

They are all talking about Devops. Do you really understand it?

二叉树的遍历和性质

新零售业态下,零售电商RPA助力重塑增长

Hcip day 12 notes

The level "trap" of test / development programmers is not a measure of one-dimensional ability

Sample imbalance - entry 0
随机推荐
mysql创建存储过程---------[HY000][1418] This function has none of DETERMINISTIC, NO SQL
2022 software testing skills robotframework + selenium library + Jenkins web Keyword Driven Automation practical tutorial
Wechat applet pictures are scaled according to the screen scale
[Star Project] small hat aircraft War (VI)
Promise from introduction to mastery (Chapter 2 understanding and use of promise)
Synchronized details
Unreal ue4.27 switchboard porting engine process
Flex开发网页实例web端
MySQL create stored procedure ------ [hy000][1418] this function has none of deterministic, no SQL
Common modules of ros2 launch files
shell正则和元字符
【愚公系列】2022年07月 Go教学课程 019-循环结构之for
Traversal and properties of binary trees
Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
Software testing interview question: why should we carry out testing in a team?
Comparison between hardware SPI and software analog SPI rate
Forget the root password
Flex layout learning completed on PC side
【数据库数据恢复】SQL Server数据库磁盘空间不足的数据恢复案例
Hcip day 12 notes