Using its own floating layout

<!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;
}
.left{
width: 200px;
height: 300px;
background-color: pink;
float: left;
}
.right{
width: 150px;
height: 300px;
background-color: purple;
a float: right;
}
.center {
height: 300px by;
margin-left: 200px;
margin-right: by 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>

the The method is easy to understand, but remember not to set the width to center

Guess you like

Origin www.cnblogs.com/hy96/p/11372750.html