当前位置:网站首页>flex布局中的align-content属性
flex布局中的align-content属性
2022-06-28 12:55:00 【HHppGo】
align-content属性起作用的条件:
- 对父元素设置自由盒属性
display:flex; - 并且设置排列方式为横向排列
flex-direction:row;(默认值) - 设置换行,
flex-wrap:wrap;
Demo代码:
<!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>align-content属性</title>
<style> .box {
width: 200px; display: flex; /* flex-direction: row; flex-wrap: wrap; */ flex-flow: row wrap; /* 默认值为:stretch align-content:可以取的值有 flex-start, flex-end,center,space-around,space-between,stretch */ align-content: stretch; height: 300px; background-color: grey; } .box1 {
height: 30px; width: 100px; background-color: orange; } .box2 {
height: 50px; width: 200px; background-color: red; } .box3 {
height: 30px; width: 100px; background-color: #08a9b5; } </style>
</head>
<body>
<div class="box">
<div class="box1">box1</div>
<div class="box2">box2</div>
<div class="box3">box3</div>
</div>
</body>
</html>
效果:
align-content: stretch;
align-content: flex-start;
align-content: flex-end;
align-content: center;
align-content: space-around;
align-content:space-between;
参考文章:https://blog.csdn.net/qq_40323256/article/details/102817242?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165589587016782395328090%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=165589587016782395328090&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduend~default-2-102817242-null-null.142v20rank_v33,157v15new_3&utm_term=align-content&spm=1018.2226.3001.4187
边栏推荐
- [MySQL from introduction to mastery] [advanced part] (III) creation of MySQL users_ Modification_ Delete and password settings
- 一文搞懂leveldb写操作
- 895. 最长上升子序列
- ##测试bug常用“Redmine”
- 证券账户开户哪家的费率低 怎么办理开户最安全
- Summary of 2022 China Merchants fintech competition
- Mathematical principle derivation of structured light phase shift method + multifrequency heterodyne
- Copy 10 for one article! The top conference papers published in South Korea were exposed to be plagiarized, and the first author was "original sin"?
- 嵌入式开发:估算电池寿命的7个技巧
- Finereport installation tutorial
猜你喜欢

go template with...end遍历用法
JS class 并不只是简单的语法糖!

IPETRONIK数据采集设备携手Softing Q-Vision软件致力于ADAS测试方案

Flink流处理API大合集:掌握所有flink流处理技术,看这一篇就够了

Why does CAD export PDF have no color

高考失利進哈工大,畢業卻留校要當“探索者”,丁效:科研就是厚積薄發

mysql数据库扫盲,你真的知道什么是数据库嘛

An idea plug-in that automatically generates unit tests, which improves the development efficiency by more than 70%!

Copy 10 for one article! The top conference papers published in South Korea were exposed to be plagiarized, and the first author was "original sin"?

How to install SSL certificates in Microsoft Exchange 2010
随机推荐
Go语学习笔记 - gorm使用 - 数据库配置、表新增 | Web框架Gin(七)
性能测试-01-简介
ASP. NET CORE Study02
JS class 并不只是简单的语法糖!
Jerry's wif interferes with Bluetooth [chapter]
VS2012 VC新建一个空白窗口应用
哪一个证券公司最好最安全 怎么办理开户最安全
The press conference of Tencent cloud Database & CSDN engineer's ability lightweight certification is coming
易观分析《2022年中国银行业隐私计算平台供应商实力矩阵分析》研究报告正式启动
Après avoir échoué à l'examen d'entrée à l'Université de technologie de Harbin, vous devez rester à l'Université en tant que « chercheur » après avoir obtenu votre diplôme.
Centos6.5 php+mysql MySQL library not found
Summary of 2022 China Merchants fintech competition
Flink stream processing API collection: master all Flink stream processing technologies. Just read this article
Xiaobai's e-commerce business is very important to choose the right mall system!
Unity WebGL移动端去除警告
pytorch基础
Which securities company is the best and safest? How to open an account is the safest
Jerry's wif interferes with Bluetooth [chapter]
数字孪生能源系统,打造低碳时代“透视”眼
Continuous integration practice of Baidu app based on pipeline as code





