当前位置:网站首页>学习探索-使用伪元素清除浮动元素造成的高度坍塌
学习探索-使用伪元素清除浮动元素造成的高度坍塌
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>
边栏推荐
- 黑马--Redis篇
- 基于蝴蝶种类识别
- ROS自定义消息发布订阅示例
- The dplyr package of R language performs data grouping aggregation statistical transformations and calculates the grouping mean of dataframe data
- Understanding disentangling in β- VAE paper reading notes
- short i =1; i=i+1与short i=1; i+=1的区别
- 打家劫舍III[后序遍历与回溯+动态规划]
- R language ggplot2 visual time series histogram: visual time series histogram through two-color gradient color matching color theme
- Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic
- Interface test tool - postman
猜你喜欢
RT-Thread 组件 FinSH 使用时遇到的问题
[paper notes] transunet: transformers make strongencoders for medical image segmentation
AUTOCAD——中心线绘制、CAD默认线宽是多少?可以修改吗?
保证接口数据安全的10种方案
Solution of commercial supply chain management platform for packaging industry: layout smart supply system and digitally integrate the supply chain of packaging industry
Detailed idea and code implementation of infix expression to suffix expression
Cereals Mall - Distributed Advanced p129~p339 (end)
提前解锁 2 大直播主题!今天手把手教你如何完成软件包集成?|第 29-30 期
思维导图+源代码+笔记+项目,字节跳动+京东+360+网易面试题整理
反射及在运用过程中出现的IllegalAccessException异常
随机推荐
Dark horse -- redis
渲大师携手向日葵,远控赋能云渲染及GPU算力服务
Abstract classes and abstract methods
深入分析,Android面试真题解析火爆全网
Problems encountered in using RT thread component fish
保证接口数据安全的10种方案
关于静态类型、动态类型、id、instancetype
思维导图+源代码+笔记+项目,字节跳动+京东+360+网易面试题整理
时钟轮在 RPC 中的应用
Understanding disentangling in β- VAE paper reading notes
Computer network: sorting out common network interview questions (I)
[translation] a GPU approach to particle physics
R语言使用dt函数生成t分布密度函数数据、使用plot函数可视化t分布密度函数数据(t Distribution)
zabbix 代理服务器 与 zabbix-snmp 监控
Use of deg2rad and rad2deg functions in MATLAB
Analysis of frequent chain breaks in applications using Druid connection pools
Looting iii[post sequence traversal and backtracking + dynamic planning]
ACTF 2022圆满落幕,0ops战队二连冠!!
Wx applet learning notes day01
包装行业商业供应链管理平台解决方案:布局智慧供应体系,数字化整合包装行业供应链