标签:meta padding htm nta enter pos 浮动 utf-8 font
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>浮动</title>
<style>
*{
padding: 0;
margin: 0;
}
.container{
width: 100%;
background-color: green;
min-height: 500px;
position: relative;
}
.left{
width: 200px;
height: 300px;
background-color: pink;
position: absolute;
top: 0;
left:0;
position: absolute;
}
.right{
width: 150px;
height: 300px;
background-color: purple;
position: absolute;
top: 0;
right: 0;
}
.center{
height: 300px;
margin-left: 200px;
margin-right: 150px;
background-color: blue;
}
</style>
</head>
<body>
<div class="container">
<div class="left"></div>
<div class="right"></div>
<div class="center">
5236
</div>
</div>
</body>
</html>
与浮动法原理一样
标签:meta padding htm nta enter pos 浮动 utf-8 font
原文地址:https://www.cnblogs.com/hy96/p/11372767.html