<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.top{
width: 100%;
height: 90px;
background-color: floralwhite;
}
.top1{
width:1920px;
height: 90px;
background-color: red;
margin: 0 auto;
}
.top2{
width: 1200px;
height: 90px;
background-color: yellow;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="all">
<div class="top">
<div class="top1">
<div class="top2">1</div>
</div>
</div>
<div class="main">中</div>
<div class="footer">腳</div>
</div>
</body>
</html>
放到100% 中間的 top2 無法劇中 不知道是什么原因 大佬幫忙看下
uj5u.com熱心網友回復:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.top {
width: 100%;
height: 90px;
background-color: floralwhite;
}
.top1 {
/* width: 1920px; */
height: 90px;
background-color: red;
margin: 0 auto;
}
.top2 {
width: 1200px;
height: 90px;
background-color: yellow;
margin: 0 auto;
text-align: center;
}
</style>
</head>
<body>
<div class="all">
<div class="top">
<div class="top1">
<div class="top2">1</div>
</div>
</div>
<div class="main">中</div>
<div class="footer">腳</div>
</div>
</body>
</html>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/244995.html
標籤:HTML5
