gpt4 book ai didi

html - 粘性页脚问题

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

我在使用粘性页脚技巧时遇到问题。问题是我想让左侧导航菜单的右边框(实际上边框是内容 div 的左边框)适合#container 的高度。但是正如您在给定链接上看到的那样,我只能看到右边框的 20-30%。我该如何解决?请帮忙

页面链接 http://smiths-heimann.az/?page=2

最佳答案

--在css中使用背景--

使用 1 像素高和 998 像素宽的背景图片,其中包含“边框”像素。这将解决这个问题。

我举了个例子:

在 css 中的#container 下添加这一行:

background: url("http://www.elbowroom.co.il/test.png") repeat-y; (it works)

您可以稍后将其替换为您自己的背景。

--使用 jQuery--您可以定义内容的高度以随容器的高度扩展。

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">

$(function(){

$("div#content").height($(div#container).height() - ???);
$(window).resize(function(){
$("div#content").height($(div#container).height() - ???);
});
});
</script>

用适合您的数量替换问号。

关于html - 粘性页脚问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7709615/

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