当前位置:网站首页>float浮动初步理解
float浮动初步理解
2022-07-28 10:29:00 【差不少】
float 浮动
三个值:
none 默认值。元素不浮动,并会显示在其在文本中出现的位置。
left 元素向左浮动
right 元素向右浮动
inherit 规定应该从父元素继承 float 属性的值。
特性:
脱离标准文档流,摆脱块级元素与行内元素的限制。
自动贴靠,超出行宽时,下个同级元素自动找空隙贴靠。与浮动的元素高度相加超过浮动元素的前一个元素的高度时,才自动换行。
脱离标准文档流,却没有脱离文本流。碰到文本会出现被包围效果,称为字围效果。
收缩效果,如果父元素没有设置高度,父元素会变成内容宽高,如果没有内容,父元素消失。
清除浮动:
浮动的弊端:
父元素如果没设高度,父元素高度坍塌,父元素消失
导致页面结构不稳定

边栏推荐
猜你喜欢

ICML 2022 | 图表示学习的结构感知Transformer模型

Inverse element & combinatorial number & fast power

Machine learning -- handwritten English alphabet 3 -- engineering features

SDUT Round 9 2020 Spring Festival campaign

Excel word simple skills sorting (continuous update ~)

Two years of crud, two graduates, two months of preparation for the interview with ALI, and fortunately won the offer grading p6
![Implement a queue with two stacks [C language]](/img/8a/679575bb0a562eff7e4317e64b4790.png)
Implement a queue with two stacks [C language]

Batch Normlization

Blue Bridge Cup embedded Hal library USART_ TX

11_ue4进阶_男性角色换成女性角色,并修改动画
随机推荐
Yarn报错:Could not find any valid local directory for nmPrivate/
Attention 注意力机制流程框图
GKRandomSource
蓝桥杯嵌入式-HAL库-ADC
andorid 开发
Markdown to word or PDF
GKCylindersNoiseSource
Development environment configuration of nodemcu
Samba server configuration
两年CRUD,二本毕业,备战两个月面试阿里,侥幸拿下offer定级P6
GKNoise
哈希表的相关知识点
GKPolygonObstacle
GKSphereObstacle
11_ue4进阶_男性角色换成女性角色,并修改动画
Characteristics and installation of non relational database mongodb
GKCylindersNoiseSource
Blue Bridge Cup embedded Hal library USART_ TX
Apb2 and apb1 in stm32
GKVoronoiNoiseSource