关于浮动和(块级、行级、行级块)元素(及文字)的互动。
测试代码如下:
<!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>
body{
/* text-align: center; */
height: 500px;
background-color: antiquewhite;
}
div{
width: 960px;
float: left;
border:1px solid aqua;
}
p{
text-align: center;
border: 1px solid blueviolet;
}
</style>
</head>
<body>
<div>浮动元素</div>
<p style="width: 1600px;height: 600px;">p元素文字p元素文字p元素文字p元素文字</p>
</body>
</html>
呈现效果:
浙公网安备 33010602011771号