gpt4 book ai didi

CSS - 三个相邻的 div 和 100% 高度

转载 作者:行者123 更新时间:2023-11-28 09:40:33 25 4
gpt4 key购买 nike

我正在为一个网站设计布局,我正在尝试为下图中的布局设置我的 css 规则: layout

我想让左右div延伸到content div的高度,我不太熟悉clear属性以及如何使用它。这是我到目前为止所做的:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<title>Untitled Document</title>
<style type="text/css">
<!--

html, body
{
height: 100%;
min-height: 100%;
margin: 0;
padding: 0;
}
#header {
background: url(images/header.png) no-repeat;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
clear: both;
padding: 15px;
width: 1013px;
height: 46px;
}
#wrapper {
clear: both;
width: 1043px;
margin-top: 10px;
margin-right: auto;
margin-bottom: 10px;
margin-left: auto;
height: 100%;
min-height: 100%;
}
#content {
background: #F00 url(images/fondo%20light.jpg) repeat;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
color: #333;
z-index: 1;
float: left;
width: 985px;
clear: none;
padding: 0px;
height: 150px;
}
#lines-left {
background: url(images/lines-left.png) no-repeat;
float: left;
width: 17px;
height: 100%;
margin-left: 13px;
}
#lines-right {
background: url(images/lines-right.png) no-repeat;
float: right;
width: 17px;
height: 100%;
padding: 0px;
margin-top: 0px;
margin-right: 11px;
margin-bottom: 0px;
margin-left: 0px;
}
body {
background: url(images/dark-pattern.jpg);
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 11px;
color: #FFF;
margin: 0px;
}
#footer {
background: url(images/footer.png) no-repeat;
height: 140px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
clear: both;
padding: 15px;
width: 1013px;
}
-->
</style>
</head>

<body>
<div id="wrapper">

<div id="header">Content for id "header" Goes Here</div>
<div id="lines-left">&nbsp;</div>
<div id="content">Content for id "content" Goes Here</div>
<div id="lines-right">&nbsp;</div>

<div id="footer">Content for id "footer" Goes Here</div>

</div>
</body>
</html>

最佳答案

关于CSS - 三个相邻的 div 和 100% 高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7472227/

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