当前位置:网站首页>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;
}边栏推荐
- 乱打日志的男孩运气怎么样我不知道,加班肯定很多
- 【C语言】三子棋(智能下棋 + 阻拦玩家)
- 数据库表结构生成excel工具
- 详解:到底什么是GPS北斗授时服务器?
- Outlook tutorial, how to create an electronic signature in outlook?
- I don't know how lucky the boy who randomly typed logs is. There must be a lot of overtime
- Random number setting and reference between parameters
- 用户身份标识与账号体系实践
- Explanation of C value type and reference type
- Unity xchart3.0 basic usage quick start
猜你喜欢

I don't know how lucky the boy who randomly typed logs is. There must be a lot of overtime

36. JS animation

How to introduce your project experience?

Gao Zhiwei: data management enables the digital transformation of the transportation industry

Configuration file settings for remote connection to Windows version server redis

开放原子开源基金会黄金捐赠人优博讯携手合作伙伴,助力OpenHarmony破圈!

Basic part 2 of flowable

Floweable foundation Chapter 1

On contract testing

用户身份标识与账号体系实践
随机推荐
vector实现
mysql 数据库 期末复习题库
Study and exploration of Redux API implementation of Redux
40余岁的边缘老技术,是未来乏力还是掘地而起?
What kind of framework is friendly to developers?
Webassembly 2022 questionnaire results are fresh
Summary of pit trampling records and solutions of data warehouse project
上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展
Libyuv module
开放原子开源基金会黄金捐赠人优博讯携手合作伙伴,助力OpenHarmony破圈!
QoS服务质量五QoS边界行为之流量整形
Introduction to translation professional qualification (level) examination
Gao Zhiwei: data management enables the digital transformation of the transportation industry
Fluent text editor
[machine learning] naive Bayesian code practice
System architect learning
【机器学习】逻辑回归代码练习
Pyqt5 rapid development and practice 6.1 three dimensions of good software & 6.2 layout management in pyqt5 & 6.3 absolute location layout of pyqt5
Custom configuration
【BERT-多标签文本分类实战】之一——实战项目总览