gpt4 book ai didi

html - DIV 页脚不匹配

转载 作者:太空宇宙 更新时间:2023-11-04 02:41:08 25 4
gpt4 key购买 nike

所以这就是我要创建的。我在代码中有它,看起来还不错。但是 div 页脚不匹配。 Layout draft

我的代码:

body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #42413C;
margin: 0;
padding: 0;
color: #000;
}


.container {
width: 100%;
height: 100%
background: #FFF;
margin: 0 auto;
}

.content ul, .content ol {
padding: 0 15px 15px 40px;
}


.footer {
padding: 10px 0;
background: #CCC49F;
position: relative;
}

.header {
width: 100%;
height: 100px;
background: #ADB96E;
}

.sidebar1 {
width: 20%;
height: 1000px;
float: left;
background: #EADCAE;
padding-bottom: 10px;
}

.sidebar2 {
width: 10%;
height: 950px;
float: left;
background: #EADCAE;
padding-bottom: 10px;
}

.content {
float:left;
padding: 10px 0;
width: 70%;
height: 950px;
float: left;
background: #CF3
}

.Hybrid {
float:left;
padding: 10px 0;
width: 10%;
height: 50px;
float: left;
background: #CCC49F
}

.menu {
float:left;
padding: 10px 0;
width: 70%;
height: 50px;
float: left;
background: #CCC49F
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

<div class="container">
<div class="header">HEADER<!-- end .header --></div>
<div class="sidebar1">SIDEbar<!-- end .sidebar1 --></div>
<div class="Hybrid">Hybrid</div>
<div class="menu">Menu</div>
<div class="sidebar2">SCHEEF<!-- end .sidebar1 --></div>

<div class="content">content</div>
<div class="footer">Footer<!-- end .footer --></div>
<!-- end .container --></div>
</body>
</html>

只是似乎没有发现我做错的事情。我认为这只是我看不到的愚蠢行为。

最佳答案

在我看来,从图片中获取布局的标记是错误的。

检查这个:https://jsfiddle.net/yotz6r4h/2/

html

<div class="header">header</div>

<div class="main">

<div class="sidebar1">
sidebar1
</div>

<div class="wrapper">

<div class="menu">
menu
</div>

<div class="sidebar2">
sidebar2
</div>

<div class="content">
content
</div>

</div>

</div>

<div class="footer">footer</div>

CSS

.header {
width: 100%;
height: 100px;
background: #ADB96E;
}

.main:after {
content: "";
display: table;
clear: both;
}

.sidebar1 {
width: 20%;
height: 1000px;
float: left;
background: #EADCAE;
padding-bottom: 10px;
}

.wrapper {
width: 80%;
float: left;
height: 1000px;
padding-bottom: 10px;
}

.menu {
padding: 10px 0;
height: 50px;
background: #CCC49F;
}

.sidebar2 {
width: 10%;
height: 930px;
float: left;
background: #aaa;
padding-bottom: 10px;
}

.content {
width: 90%;
float: left;
background: #CF3;
height: 940px;
}

.footer {
padding: 10px 0;
background: #CCC49F;
}

关于html - DIV 页脚不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34723363/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com