当前位置:网站首页>学习探索-使用伪元素清除浮动元素造成的高度坍塌
学习探索-使用伪元素清除浮动元素造成的高度坍塌
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>
边栏推荐
- [depth first search] Ji suanke: find numbers
- swagger2报错Illegal DefaultValue null for parameter type integer
- LeetCode-1279. Traffic light intersection
- Tensorflow and torch code verify whether CUDA is successfully installed
- ModuleNotFoundError: No module named ‘PIL‘解决方法
- 基于蝴蝶种类识别
- 全套教学资料,阿里快手拼多多等7家大厂Android面试真题
- Is not a drawable (color or path): the vector graph downloaded externally cannot be called when it is put into mipmap, and the calling error program crashes
- RT-Thread 组件 FinSH 使用时遇到的问题
- MRO industrial products enterprise procurement system: how to refine procurement collaborative management? Industrial products enterprises that want to upgrade must see!
猜你喜欢

Dark horse -- redis
![[depth first search] Ji suanke: find numbers](/img/e4/708a1e8252bcd2d0d621c66bf6bfed.jpg)
[depth first search] Ji suanke: find numbers

今日直播 | “人玑协同 未来已来”2022弘玑生态伙伴大会蓄势待发

It's super detailed in history. It's too late for you to read this information if you want to find a job

Problems encountered in using RT thread component fish

多线程基础:线程基本概念与线程的创建
时钟轮在 RPC 中的应用

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

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

全套教学资料,阿里快手拼多多等7家大厂Android面试真题
随机推荐
R language ggplot2 visual time series histogram: visual time series histogram through two-color gradient color matching color theme
Based on butterfly species recognition
Interview assault 63: how to remove duplication in MySQL?
Yutai micro rushes to the scientific innovation board: Huawei and Xiaomi fund are shareholders to raise 1.3 billion
Tongyu Xincai rushes to Shenzhen Stock Exchange: the annual revenue is 947million Zhang Chi and Su Shiguo are the actual controllers
C # - realize serialization with Marshall class
渲大师携手向日葵,远控赋能云渲染及GPU算力服务
How word displays modification traces
How can my Haskell program or library find its version number- How can my Haskell program or library find its version number?
受益匪浅,安卓面试问题
QPushButton绑定快捷键的注意事项
php+redis实现超时取消订单功能
Graffiti intelligence is listed on the dual main board in Hong Kong: market value of 11.2 billion Hong Kong, with an annual revenue of 300 million US dollars
pytorch常见损失函数
pychrm社区版调用matplotlib.pyplot.imshow()函数图像不弹出的解决方法
通俗的讲解,带你入门协程
史上超级详细,想找工作的你还不看这份资料就晚了
Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting
MRO工业品企业采购系统:如何精细化采购协同管理?想要升级的工业品企业必看!
打家劫舍III[后序遍历与回溯+动态规划]