当前位置:网站首页>学习探索-使用伪元素清除浮动元素造成的高度坍塌
学习探索-使用伪元素清除浮动元素造成的高度坍塌
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>
边栏推荐
- ModuleNotFoundError: No module named ‘PIL‘解决方法
- 第五期个人能力认证考核通过名单公布
- Pytorch common loss function
- Wx applet learning notes day01
- Mathematical knowledge -- code implementation of Gaussian elimination (elementary line transformation to solve equations)
- Translation D28 (with AC code POJ 26:the nearest number)
- It's super detailed in history. It's too late for you to read this information if you want to find a job
- Reptiles have a good time. Are you full? These three bottom lines must not be touched!
- 谷粒商城--分布式高级篇P129~P339(完结)
- Solution of intelligent management platform for suppliers in hardware and electromechanical industry: optimize supply chain management and drive enterprise performance growth
猜你喜欢

Analysis of frequent chain breaks in applications using Druid connection pools
![Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting](/img/dd/c3f4a9c38b156e3a9b9adfd6253773.gif)
Fast power template for inverse element, the role of inverse element and example [the 20th summer competition of Shanghai University Programming League] permutation counting

助力安全人才专业素养提升 | 个人能力认证考核第一阶段圆满结束!

Computer network: sorting out common network interview questions (I)

A method of removing text blur based on pixel repair

Sanmian ant financial successfully got the offer, and has experience in Android development agency recruitment and interview

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

ROS自定义消息发布订阅示例
Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic

The list of people who passed the fifth phase of personal ability certification assessment was published
随机推荐
Elastic search indexes are often deleted [closed] - elastic search indexes gets deleted frequently [closed]
R language ggplot2 visualization: use the ggdotplot function of ggpubr package to visualize dot plot, set the palette parameter, and set the colors of data points and box graphs of dot plots at differ
Multithreading Basics: basic concepts of threads and creation of threads
R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组均值(mean)
Benefit a lot, Android interview questions
Tongyu Xincai rushes to Shenzhen Stock Exchange: the annual revenue is 947million Zhang Chi and Su Shiguo are the actual controllers
第五期个人能力认证考核通过名单公布
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
Take a look at how cabloyjs workflow engine implements activiti boundary events
AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
R语言ggplot2可视化:使用ggpubr包的ggviolin函数可视化小提琴图
About static type, dynamic type, ID, instancetype
Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic
An error occurs when installing MySQL: could not create or access the registry key needed for the
ACTF 2022圆满落幕,0ops战队二连冠!!
通俗的讲解,带你入门协程
业务与应用同步发展:应用现代化的策略建议
How to improve website weight
test about BinaryTree
A full set of teaching materials, real questions of Android interview of 7 major manufacturers including Alibaba Kwai pinduoduo