当前位置:网站首页>学习探索-使用伪元素清除浮动元素造成的高度坍塌
学习探索-使用伪元素清除浮动元素造成的高度坍塌
2022-07-06 11:32:00 【miao_zz】
效果示例图

代码块
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>清除浮动元素造成的高度坍塌</title>
<style type="text/css">
.container-noclear {
border: 1px solid red;
width: 500px;
margin: 50px auto;
}
.container {
border: 1px solid red;
width: 500px;
margin: 50px auto;
}
.container::after {
content: "";
clear: both;
display: block;
}
.items {
border: 1px solid #00a2ef;
width: 100px;
height: 100px;
margin: 11px 11px;
float: left;
}
</style>
</head>
<body>
<div class="container">
<div class="items">1</div>
<div class="items">2</div>
<div class="items">3</div>
<div class="items">4</div>
<div class="items">5</div>
<div class="items">6</div>
<div class="items">7</div>
</div>
<div class="container-noclear">
<div class="items">1</div>
<div class="items">2</div>
<div class="items">3</div>
<div class="items">4</div>
<div class="items">5</div>
<div class="items">6</div>
<div class="items">7</div>
</div>
</body>
</html>
边栏推荐
- Druid 数据库连接池 详解
- Master Xuan joined hands with sunflower to remotely control enabling cloud rendering and GPU computing services
- 黑马--Redis篇
- C # - realize serialization with Marshall class
- AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
- CCNP Part 11 BGP (III) (essence)
- Lucun smart sprint technology innovation board: annual revenue of 400million, proposed to raise 700million
- Intelligent supply chain management system solution for hardware and electromechanical industry: digital intelligent supply chain "creates new blood" for traditional industries
- test about BinaryTree
- 今日直播 | “人玑协同 未来已来”2022弘玑生态伙伴大会蓄势待发
猜你喜欢

Black Horse - - Redis Chapter

数学知识——高斯消元(初等行变换解方程组)代码实现

Pytorch common loss function

PMP practice once a day | don't get lost in the exam -7.6

Synchronous development of business and application: strategic suggestions for application modernization

Yutai micro rushes to the scientific innovation board: Huawei and Xiaomi fund are shareholders to raise 1.3 billion

A method of removing text blur based on pixel repair

pychrm社区版调用matplotlib.pyplot.imshow()函数图像不弹出的解决方法

Analysis of frequent chain breaks in applications using Druid connection pools

Xingnuochi technology's IPO was terminated: it was planned to raise 350million yuan, with an annual revenue of 367million yuan
随机推荐
[depth first search] Ji suanke: a joke of replacement
Dark horse -- redis
Precautions for binding shortcut keys of QPushButton
GCC [7] - compilation checks the declaration of functions, and link checks the definition bugs of functions
RT-Thread 组件 FinSH 使用时遇到的问题
R语言使用dt函数生成t分布密度函数数据、使用plot函数可视化t分布密度函数数据(t Distribution)
A method of removing text blur based on pixel repair
Use map function and split function to type multiple elements in one line
It's super detailed in history. It's too late for you to read this information if you want to find a job
Test technology stack arrangement -- self cultivation of test development engineers
关于图像的读取及处理等
Unlock 2 live broadcast themes in advance! Today, I will teach you how to complete software package integration Issues 29-30
Intelligent supply chain management system solution for hardware and electromechanical industry: digital intelligent supply chain "creates new blood" for traditional industries
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
黑马--Redis篇
C # - realize serialization with Marshall class
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组均值(mean)
Lucun smart sprint technology innovation board: annual revenue of 400million, proposed to raise 700million
swagger2报错Illegal DefaultValue null for parameter type integer
渲大师携手向日葵,远控赋能云渲染及GPU算力服务