当前位置:网站首页>Elastic box auto wrap demo
Elastic box auto wrap demo
2022-06-28 13:07:00 【HHppGo】
Code :
<!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> Flex box wrap </title>
<style> * {
margin: 0; padding: 0; } .box {
/*2. Use flex Layout Arrange children horizontally Insufficient parent width Child auto scaling And the expansion will never exceed the width of the parent box Children do not wrap */ display: flex; /* 3. demand : Use Flex The layout makes the children horizontal , And the width of the parent is not enough , Child word wrap */ /* The default value is , No line wrapping */ /* flex-wrap: nowrap; */ /* Word wrap */ flex-wrap: wrap; /* 4. When using flex-wrap Give Way flex When the layout can be arranged in multiple rows , Alignment can be set between rows */ /* There is no space between lines , Vertical center */ /* align-content: center; */ /* The first and last lines are at the top and bottom of the elastic container */ align-content: space-between; height: 500px; border: 1px solid #000; } .box div {
/* 1. Use floats to arrange children horizontally Insufficient width of parent , Child word wrap */ /* float: left; */ width: 100px; height: 100px; background-color: pink; } </style>
</head>
<body>
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
</div>
</body>
</html>
effect :
边栏推荐
- 哈希竞猜游戏系统开发技术成熟案例及源码
- Go language learning notes - Gorm usage - database configuration, table addition | web framework gin (VII)
- 基于SSM实现水果蔬菜商城管理系统
- Copying open source for basic software is not advisable. Self reliance is the right way
- flutter 系列之:flutter 中常用的 GridView layout 详解
- How to handle the safest account opening when downloading the mobile app of Huatai Securities
- Tencent tangdaosheng: facing the new world of digital and real integration, developers are the most important "architects"
- matlab plotyy 坐标轴设置,[转载]Matlab plotyy画双纵坐标图实例[通俗易懂]
- 电子元器件分销10亿俱乐部[通俗易懂]
- Vscode如何设置自动保存代码
猜你喜欢
全志V853芯片 如何在Tina V85x平台切换sensor?
5A synchronous rectifier chip 20V to 12v2a/5v4.5a high current 24W high power synchronous rectifier chip high current step-down IC fs2462
Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
Copying open source for basic software is not advisable. Self reliance is the right way
Setup and upload of arduino-esp32 flash file plug-in program
Go语学习笔记 - gorm使用 - 数据库配置、表新增 | Web框架Gin(七)
Realization of a springboard machine
基础软件照搬开源不可取,自力更生才是正途
Online JSON to plaintext tool
开源项目维权成功案例: Spug 开源运维平台成功维权
随机推荐
async-validator.js数据校验器
align-items 与 align-content 的区别
电子元器件分销10亿俱乐部[通俗易懂]
I²C、SMBus、PMBus关系
Buuctf:[wustctf2020] plain
scratch旅行相册 电子学会图形化编程scratch等级考试一级真题和答案解析2022年6月
Implementation of fruit and vegetable mall management system based on SSM
Hisilicon 35xx realizes gt911 touch screen function "suggestions collection"
c语言中的类结构体-点号
##测试bug常用“Redmine”
How to handle the safest account opening when downloading the mobile app of Huatai Securities
pytorch模型
Centos7:切换mysql用户并登录mysql
How does Quanzhi v853 chip switch sensors on Tina v85x platform?
Stm32f1 and stm32cubeide programming example - matrix keyboard driver
The English translation of heartless sword Zhu Xi's two impressions of reading
如何在熊市中寻找机会?
同花顺上怎么进行开户啊, 安全吗
FS7022方案系列FS4059A双节两节锂电池串联充电IC和保护IC
新品体验:阿里云新一代本地SSD实例i4开放公测