浮动的元素可以覆盖标准流中的块级元素
那么
浮动元素不能覆盖哪些元素呢?
- 浮动的元素不能覆盖行内块元素
- 浮动元素不能覆盖行内元素
- 浮动的元素不能覆盖文字(图文环绕 最初的目的)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.father {
width: 400px;
height: 400px;
background-color: green;
}
.red {
width: 100px;
height: 100px;
background-color: red;
float: left;
}
.blue {
width: 110px;
height: 110px;
background-color: blue;
}
</style>
</head>
<body>
<div class="father">
<div class="red"></div>
<div class="blue">我是文字</div>
</div>
</body>
</html>