gpt4 book ai didi

css - XHTML CSS Auto Height Div 问题

转载 作者:行者123 更新时间:2023-11-28 15:02:30 25 4
gpt4 key购买 nike

基本上,我正在布置一个网站,我使用 DIV 来设置页眉、左栏、右栏和页脚。我想让网站的内容部分可扩展为插入其中的 html/文本,所以我一直在使用 height: auto。

我在页眉顶部和页脚底部使用背景图片,在网站正文中使用 1px 高的填充符。

我的问题是,如果我尝试让右列位于左列的右侧而不是在其下方,我所尝试的一切基本上都消除了中间背景图像。

我敢肯定这可能是一件非常简单的事情,但我从昨晚开始就一直在做这件事,我快要完成了想弄明白的事情。

它是有效的 XHTML 和 CSS(除了属于 CSS3 的 jQuery UI 之外,尽管这在结构上应该无关紧要)。

关于如何使用背景图像获得两栏布局的任何想法或有人可以给我指点教程吗?

<body>
<div id="top">
THE TOP IMAGE GOES HERE IN CSS
</div>
<div id="wrapper">
<div id="header">

</div>

<div id="navigation">
</div>

<div id="content">
<div id="left-col">

</div>

<div id="right-col">

</div>

</div>
</div>

<div id="bottom">
THE BOTTOM IMAGE GOES HERE IN CSS
</div>

<div id="footer">

</div>
</body>


#wrapper {
margin: 0 auto;
width: 838px;
background-image:url('../images/wrapper_bg.gif');
background-repeat:repeat-y;

}
#header {
width: 818px;
color: #333;
padding: 10px;
height: 100px;
}

#navigation {
width: 838px;
}

#content {
width: 838px;
color: #333;
margin: 0px 0px 0px 0px;

/*min-height: 800px;*/
height: auto;
}
#footer {
width: 838px;
color: #333;
text-align: center;

}

#top{
margin: 0 auto;
width: 838px;
height:14px;
background-image:url('../images/wrapper_top.gif');
}

#bottom{
clear: both;
margin: 0 auto;
width: 838px;
height:14px;
background-image:url('../images/wrapper_bottom.gif');
}

#left-col{
margin-left: 20px;
width: 590px;
float:left;
height: auto;
}

#right-col{
width: 170px;
display: inline;

height: auto;
margin-right: 25px;
color: #777777;
font-size: 15px;
padding: 5px;
font-weight: bold;
}

http://www.wholehealthconnect.org/home.php是网站。

谁能帮我把中间的 div 扩展到内容,让右边的列紧挨着左边的列,并且在它们后面仍然有背景图片?

最佳答案

我不确定我是否正确理解了您的问题,所以请随时指出正确的方向。

基本上您希望链接:FAQ、Professional ... Facebook 显示在右侧?

为什么不用经典的:

#right-col {
float: left;
margin-left: 610px; /* or perhaps higher */
}

我的思路是否正确,还是我没有理解您提出的问题?

关于css - XHTML CSS Auto Height Div 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1510752/

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