<!DOCTYPE html>标签:浮动,color,height,特点,width,460px,background,margin,css From: https://blog.51cto.com/u_15928062/5985275
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" cnotallow="IE=edge">
<meta name="viewport" cnotallow="width=device-width, initial-scale=1.0">
<title>浮动</title>
<style>
* {
margin: 0;
padding: 0;
}
.top {
height: 40px;
background-color: #333;
}
.header {
width: 1226px;
height: 100px;
background-color: #ffc0cb;
margin: 0 auto;
}
.content {
width: 1226px;
height: 460px;
background-color: green;
margin: 0 auto;
}
.left {
width: 234px;
height: 460px;
background-color:#ffa500;
float: left;
}
.right {
width: 992px;
height: 460px;
background-color: #87ceeb;
float: left;
}
</style>
</head>
<body>
<div class="top">头部</div>
<div class="header"></div>
<div class="content">
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>
<!-- left 和right是content的子元素 -->
<!--
书写顺序
1.浮动/display
2.盒子模型 magin border pdding 宽度高度背景色
3.文字样式 -->