Html 将页眉固定在跃点,将页脚固定在底部
我是css新手 如何在页面的完整底部显示页脚 我在此页面中的问题:Html 将页眉固定在跃点,将页脚固定在底部,html,css,Html,Css,我是css新手 如何在页面的完整底部显示页脚 我在此页面中的问题:http://techdefeat.com/index.php .technology { min-height: 203em; } .foot-nav { background: #fa4b2a;} 在css中,这是我唯一的页脚 请提供一些简单的参考资料,谢谢您的帮助。对于固定页眉,您可以提供以下两种页眉样式: CSS: 我现在看不到您的页脚?对于固定页眉,您可以为两种页眉提供以下样式: CSS: 我现在看不到
http://techdefeat.com/index.php
.technology {
min-height: 203em;
}
.foot-nav { background: #fa4b2a;}
在css中,这是我唯一的页脚
请提供一些简单的参考资料,谢谢您的帮助。对于固定页眉,您可以提供以下两种页眉样式: CSS:
我现在看不到您的页脚?对于固定页眉,您可以为两种页眉提供以下样式: CSS:
我现在看不到您的页脚?用于在滚动时保持页眉在顶部,页脚在底部 为
.technology
设置填充底部,这是您的主要div。它应该等于您的页脚的高度
JS(jQuery):
$(function(){
$(window).scroll(function(){
var headTop = $('.header-top').height();
if($(this).scrollTop()>=headTop){
$('.head-bottom').addClass('head-top');
else
$('.head-bottom').removeClass('head-top');
}
});
});
.head-top{
position: fixed;
width: 100%;
z-index: 999;
}
.technology{
overflow:hidden;
padding-bottom: 180px; // must be same height as the footer
}
.foot-nav {
position: relative;
margin-top: -180px;
height: 180px;
clear:both;
}
CSS:
$(function(){
$(window).scroll(function(){
var headTop = $('.header-top').height();
if($(this).scrollTop()>=headTop){
$('.head-bottom').addClass('head-top');
else
$('.head-bottom').removeClass('head-top');
}
});
});
.head-top{
position: fixed;
width: 100%;
z-index: 999;
}
.technology{
overflow:hidden;
padding-bottom: 180px; // must be same height as the footer
}
.foot-nav {
position: relative;
margin-top: -180px;
height: 180px;
clear:both;
}
用于滚动时保持页眉在顶部,页脚在底部 为
.technology
设置填充底部,这是您的主要div。它应该等于您的页脚的高度
JS(jQuery):
$(function(){
$(window).scroll(function(){
var headTop = $('.header-top').height();
if($(this).scrollTop()>=headTop){
$('.head-bottom').addClass('head-top');
else
$('.head-bottom').removeClass('head-top');
}
});
});
.head-top{
position: fixed;
width: 100%;
z-index: 999;
}
.technology{
overflow:hidden;
padding-bottom: 180px; // must be same height as the footer
}
.foot-nav {
position: relative;
margin-top: -180px;
height: 180px;
clear:both;
}
CSS:
$(function(){
$(window).scroll(function(){
var headTop = $('.header-top').height();
if($(this).scrollTop()>=headTop){
$('.head-bottom').addClass('head-top');
else
$('.head-bottom').removeClass('head-top');
}
});
});
.head-top{
position: fixed;
width: 100%;
z-index: 999;
}
.technology{
overflow:hidden;
padding-bottom: 180px; // must be same height as the footer
}
.foot-nav {
position: relative;
margin-top: -180px;
height: 180px;
clear:both;
}
这是我的标题解决方案 css
.head-bottom {
background: #fa4b2a;
position:fixed;
width:100%;
z-index:100;
}
.tech-no {
/* position: absolute; */
/ top: -33px; /
}
JS
$(window).scroll(function(e){
var $el = $('.head-bottom');
var isPositionFixed = ($el.css('position') == 'fixed');
if ($(this).scrollTop() > 200 && !isPositionFixed){
$('.head-bottom').css({'position': 'fixed', 'top': '0px'});
}
if ($(this).scrollTop() < 200 && isPositionFixed)
{
$('.head-bottom').css({'position': 'static', 'top': '0px'});
}
});
$(窗口)。滚动(函数(e){
变量$el=$('头底');
var isPositionFixed=($el.css('position')='fixed');
如果($(this).scrollTop()>200&!isPositionFixed){
$('.head-bottom').css({'position':'fixed','top':'0px'});
}
if($(this).scrollTop()<200&&isPositionFixed)
{
$('.head-bottom').css({'position':'static','top':'0px'});
}
});
正在寻找修复页脚解决方案。谢谢大家。这是我的标题解决方案 css
.head-bottom {
background: #fa4b2a;
position:fixed;
width:100%;
z-index:100;
}
.tech-no {
/* position: absolute; */
/ top: -33px; /
}
JS
$(window).scroll(function(e){
var $el = $('.head-bottom');
var isPositionFixed = ($el.css('position') == 'fixed');
if ($(this).scrollTop() > 200 && !isPositionFixed){
$('.head-bottom').css({'position': 'fixed', 'top': '0px'});
}
if ($(this).scrollTop() < 200 && isPositionFixed)
{
$('.head-bottom').css({'position': 'static', 'top': '0px'});
}
});
$(窗口)。滚动(函数(e){
变量$el=$('头底');
var isPositionFixed=($el.css('position')='fixed');
如果($(this).scrollTop()>200&!isPositionFixed){
$('.head-bottom').css({'position':'fixed','top':'0px'});
}
if($(this).scrollTop()<200&&isPositionFixed)
{
$('.head-bottom').css({'position':'static','top':'0px'});
}
});
正在寻找修复页脚解决方案。谢谢大家。请分享您的代码,这样我们可以帮助您解决问题:)您能看到页面源代码吗。?是的,但如果您为您的问题分享相关代码,而不是仅仅“难道您不能看到页面源代码”,我们会更容易帮助您。到目前为止,你尝试过做什么?嗯。是的,给我一点时间。你能分享你的代码吗?请分享你的代码,这样我们就可以帮助你解决问题:)你能看到页面源代码吗?是的,但是如果你为你的问题分享相关代码,而不是仅仅“你不能看到页面源代码”,我们会更容易帮助你。到目前为止你做了什么?嗯。是的,给我一点时间。你能分享代码吗?
。foot nav{background:#fa4b2a;}
在css中,这是我唯一的页脚。请在那只脚周围添加一个页脚标记。navi将上面的代码添加到div中,但是当滚动时,div并没有出现在顶部。这是因为你只把它给了班头和班尾。那不是我写的。看看我的答案,看看代码应该放在哪里。是的,是真的,但是我们可以在滚动时移动头部底部
顶部。.foot nav{background:#fa4b2a;}
在css中这是我唯一的页脚。请在该页脚周围添加页脚标记。navi将上述代码添加到div中,但是当滚动时,div并没有出现在顶部。这是因为你只把它给了班头和班尾。那不是我写的。看看我的答案,看看代码应该在哪里。是的,但是当我们滚动时,我们可以移动head-bottom
top。我找到了页眉柄的解决方案,等待页脚解决方案。你能删除overflow:auto
并提供一些其他解决方案。我不想要自动流动。我想在死端显示页脚我找到了页眉Shankat的解决方案,正在等待页脚解决方案。请删除overflow:auto
并提供一些其他解决方案。我不想要自动流动。我想在死胡同处显示页脚