点击新页面后,网页会改变尺寸

时间:2016-08-02 04:37:59

标签: html css web styles

我对HTML和CSS相当新,所以请耐心等待......

我正在尝试在主网页上链接不同的页面,每当我更改页面时,整个新页面都会被重新格式化。

任何人都知道它会出现什么问题?

我在网上使用了一个粘性页脚代码片段,它似乎来自于此。我使用了一个页面来扭曲整个页面并使页脚粘到底部。

* {
margin: 0;
}
html, body {
   height: 100%;
}
.page-wrap {
    min-height: 100%;
    /* equal to footer height */
    margin-bottom: -40px; 
}
.page-wrap:after {
    content: "";
    display: block;
}
.main-footer, .page-wrap:after {
     height: 40px; 
}
.main-footer {
    background: orange;
}

1 个答案:

答案 0 :(得分:1)

我认为问题只是你的html正文的位置。 尽量确定其位置

body{
    position:fixed;
    }

用于固定底部的页脚使用给定的代码并删除.main-footer的css,.page-wrap:after和.page-wrap:after

body{
 position:fixed;
}
.page-wrap {
min-height: 100%;
}
.main-footer {
background: orange;
position:fixed;
}

还在html中为父div提供bootstrap类

<html>
<body>    
<div class="container">
 ....
</div> 
</body>
</html>
相关问题