当前位置:网站首页>Div horizontal arrangement
Div horizontal arrangement
2022-07-29 09:37:00 【Sabo】
display: flex
Flex Layout The simplest way ,css3 newly added . Parent div Use it directly display: flex; that will do html
<h3>display: flex</h3>
<div class="display-flex">
<div class="div-size">1</div>
<div class="div-size">2</div>
<div class="div-size">3</div>
</div>css
.display-flex {
display: flex;
}
.div-size {
border: 1px solid red;
width: 200px;
height: 120px;
margin: 10px;
}float: left
Realize horizontal layout by floating , This layout is rarely used .( Note that setting floating elements will affect the normal arrangement of the following elements , Set up clear: both; Can solve )
html
<h3>float: left</h3>
<div>
<div class="float-left">4</div>
<div class="float-left">5</div>
<div class="float-left">6</div>
</div>
<div class="clear"></div>css
.float-left {
float: left;
border: 1px solid yellowgreen;
width: 200px;
height: 120px;
margin: 10px;
}
.clear {
clear: both;
}display:inline-block
Inline block element .(CSS2.1 Added value )
html
<h3>display: inline-block</h3>
<div>
<div class="inline-block">7</div>
<div class="inline-block">8</div>
<div class="inline-block">9</div>
</div>css
.inline-block {
display: inline-block;
border: 1px solid blue;
width: 200px;
height: 120px;
margin: 10px;
}边栏推荐
- How to query express logistics and filter out no information doc No. to delete or copy
- MySQL事务与MVCC如何实现的隔离级别
- How does alternates achieve high-performance publish and subscribe?
- On contract testing
- Retinal Vessel Segmentation via a Semantics and Multi-Scale Aggregation Network
- Is the marginal old technology in its 40s weak in the future or rising from the ground?
- Use cpolar to publish raspberry pie web pages (improvement of cpolar function)
- 《LOL》从代码上来说最难的是哪个英雄?
- 高智伟:数据管理赋能交通行业数字化转型
- Trie树(字典树)讲解
猜你喜欢

高智伟:数据管理赋能交通行业数字化转型

Vs2015 uses loadlibrary to call DLL library

Virtual machines use host graphics cards (Hyper-V and wsl2)
![[Bert multi label text classification practice] I - overview of practical projects](/img/47/3e6cf5d49e41a03ea7f9b6eb295e1d.png)
[Bert multi label text classification practice] I - overview of practical projects

Introduction to translation professional qualification (level) examination

用户身份标识与账号体系实践

Asp graduation project - based on C # +asp Design and implementation of enterprise investment value analysis system based on. Net + sqlserver (graduation thesis + program source code) -- enterprise in

【BERT-多标签文本分类实战】之一——实战项目总览

Basic operations of OpenCV image processing

How to realize the isolation level between MySQL transactions and mvcc
随机推荐
On contract testing
Unity3d hodgepodge
How to contribute to openharmony
Basic part 2 of flowable
系统架构师学习
AxureRP原型设计 快速开始
Acwing game 59 [End]
Zhongang Mining: four steps for sustainable and healthy development of fluorite industry
Unity xchart3.0 basic usage quick start
Virtual machines use host graphics cards (Hyper-V and wsl2)
分布式Session共享的4类技术方案,与优劣势比较
Parameter initialization
Random number setting and reference between parameters
Use cpolar to publish raspberry pie web pages (improvement of cpolar tunnel)
怎样查询快递物流筛选出无信息单号删除或者复制
引入redis缓存出现的问题以及解决方式
Handwritten character recognition
数仓项目踩坑记录与解决方法总结
Unity guidance system. Click the target object and prompt the text to change color to enter the next step
附录2-一些简单的练习