当前位置:网站首页>The setting float cannot float above the previous Div
The setting float cannot float above the previous Div
2022-07-24 12:35:00 【Yidamu salty alcohol】
I stepped on another pit today , I forgot float The original effect of the style 【 cry 】.
So let's look at the code :
html Code :
<body>
<div class="box1"></div>
<div class="box2"> Setting the float will only affect the layout of the following elements </div>
<div class="box3"></div>
</body>
css Code :
.box1{
width: 200px;
height: 200px;
background-color: red;
}
.box2{
width: 100px;
height: 100px;
border: 1px solid yellow;
}
.box3{
width: 200px;
height: 200px;
border: 1px solid black;
}
It's not given here .box2 Set float , The effect is as follows :
To reset .box2 The style of :
.box2{
width: 100px;
height: 100px;
border: 1px solid yellow;
float: left;
}
effect :
You can see that ,float The style will only affect the layout of the following elements , I've been thinking about making a layout before , I set up float:left; Why? div Can't float up , I forgot the floating feature , Remind yourself here , I also hope someone can solve your doubts by reading this article .
边栏推荐
- C进阶——数据的存储
- MES系统设备管理概述(中)
- Equal principal increasing repayment / equal principal decreasing mortgage repayment calculator
- 基于Kubernetes v1.24.0的集群搭建(三)
- Calculate the distance between the longitude and latitude of two coordinates (5 ways)
- C Advanced - data storage
- thinkphp 实现数据库备份
- Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
- What kind of experience is a monthly salary of 30000 yuan? Can we achieve this level as we media
- QWaitCondition 的正确使用方法
猜你喜欢

thinkphp 实现数据库备份

突破内存墙能带来什么?看火山引擎智能推荐服务节支增效实战

How to realize the function of grabbing red envelopes in IM system?

Everything about native crash
How to render millions of 2D objects smoothly with webgpu?

Native Crash的一切

【Rust】引用和借用,字符串切片 (slice) 类型 (&str)——Rust语言基础12
向勒索病毒说不,是时候重塑数据保护策略

ASP. Net core deployment Manual: 1. Deployment Basics

Conference publishing function of conference OA project
随机推荐
从零实现深度学习框架——再探多层双向RNN的实现
如何最快找出复杂代码运行时的函数调用流程
Seckill implementation diagram
如何将Typora中图片上传到csdn
leetcode-81. 搜索旋转排序数组 II(二分查找返回true/false)
C进阶——数据的存储
Okaleido tiger NFT即将登录Binance NFT平台
突破内存墙能带来什么?看火山引擎智能推荐服务节支增效实战
thinkphp 实现数据库备份
Force deduction exercise - 26 split array into continuous subsequences
Native Crash的一切
QWaitCondition 的正确使用方法
Force deduction exercise - the sum of the kth smallest array in the 21 ordered matrix
支持刘海屏
Miss waiting for a year! Baidu super chain digital publishing service is limited to 50% discount
Equal principal increasing repayment / equal principal decreasing mortgage repayment calculator
Buckle practice - sum of 34 combinations
Is it safe to contact the account manager online to open a fund account?
Snowflake algorithm (PHP)
微信小程序-绘制仪表盘