当前位置:网站首页>Learn to explore - use pseudo elements to clear the high collapse caused by floating elements
Learn to explore - use pseudo elements to clear the high collapse caused by floating elements
2022-07-06 19:30:00 【miao_ zz】
Use pseudo elements to clear the high collapse caused by floating elements
Effect example picture
Code block
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> High collapse caused by removing floating elements </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>
边栏推荐
- 【翻译】供应链安全项目in-toto移至CNCF孵化器
- Lick the dog until the last one has nothing (simple DP)
- Spark foundation -scala
- Mind map + source code + Notes + project, ByteDance + JD +360+ Netease interview question sorting
- Tensorflow2.0 self defined training method to solve function coefficients
- 五金机电行业智能供应链管理系统解决方案:数智化供应链为传统产业“造新血”
- Application of clock wheel in RPC
- Detailed idea and code implementation of infix expression to suffix expression
- short i =1; I=i+1 and short i=1; Difference of i+=1
- 凤凰架构3——事务处理
猜你喜欢
A method of removing text blur based on pixel repair
【计算情与思】扫地僧、打字员、信息恐慌与奥本海默
Analysis of frequent chain breaks in applications using Druid connection pools
LeetCode_ Double pointer_ Medium_ 61. rotating linked list
Reflection and illegalaccessexception exception during application
10 schemes to ensure interface data security
Pytorch common loss function
如何自定义动漫头像?这6个免费精品在线卡通头像生成器,看一眼就怦然心动!
The second day of rhcsa study
The list of people who passed the fifth phase of personal ability certification assessment was published
随机推荐
GCC【7】- 编译检查的是函数的声明,链接检查的是函数的定义bug
Don't miss this underestimated movie because of controversy!
A popular explanation will help you get started
MATLAB中deg2rad和rad2deg函数的使用
Dark horse -- 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
map的使用(列表的数据赋值到表单,json逗号隔开显示赋值)
PMP practice once a day | don't get lost in the exam -7.6
Mysql Information Schema 學習(一)--通用錶
Carte de réflexion + code source + notes + projet, saut d'octets + jd + 360 + tri des questions d'entrevue Netease
A full set of teaching materials, real questions of Android interview of 7 major manufacturers including Alibaba Kwai pinduoduo
C # - realize serialization with Marshall class
冒烟测试怎么做
Swagger2 reports an error illegal DefaultValue null for parameter type integer
Countdown 2 days | live broadcast preview of Tencent cloud message queue data import platform
Zero foundation entry polardb-x: build a highly available system and link the big data screen
C language daily practice - day 22: Zero foundation learning dynamic planning
Translation D28 (with AC code POJ 26:the nearest number)
LeetCode-1279. 红绿灯路口
黑马--Redis篇