当前位置:网站首页>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;
}边栏推荐
猜你喜欢

OpenCV图像处理基础操作
![[苹果开发者账号]06 转让开发者账号后,开发者年费自动续费问题](/img/a7/12fd63f16ebca81a3dd2d1b97847d1.png)
[苹果开发者账号]06 转让开发者账号后,开发者年费自动续费问题

一知半解 ~题目杂记 ~ 一个多态问题

(Video + graphics) introduction to machine learning series - Chapter 1 Introduction

PyQt5快速开发与实战 6.1 好软件的三个维度 && 6.2 PyQt5中的布局管理 && 6.3 PyQt5的绝对位置布局

Summary of pit trampling records and solutions of data warehouse project

Retinal Vessel Segmentation via a Semantics and Multi-Scale Aggregation Network

Pyqt5 rapid development and practice 6.5 qgridlayout (grid layout)

Nucleic acid scanning code registration experience (how to improve the correct character recognition rate of OCR)

Random number setting and reference between parameters
随机推荐
On contract testing
一知半解 ~题目杂记 ~ 一个多态问题
【C语言】三子棋(智能下棋 + 阻拦玩家)
Senparc.Weixin.Sample.MP源码剖析
36. JS animation
Configuration file settings for remote connection to Windows version server redis
Shutter -- use camera (continuously updating)
基于C语言实现的NFA确定化和DFA最小化
"Defects" of prototype chain inheritance and constructor inheritance
Vs2015 uses loadlibrary to call DLL library
Unity 引导系统.点击目标物体后提示文字变色进入下一步
常用的DOS命令[逐渐完善]
【云驻共创】【HCSD大咖直播】亲授大厂面试秘诀
Quick sorting (quick sorting) (implemented in C language)
Unity xchart3.0 basic usage quick start
Explanation of trie tree (dictionary tree)
How to export the old and new file names and locations to excel after file renaming
View port occupancy
如何介绍自己的项目经验?
Summary of pit trampling records and solutions of data warehouse project