如何阻止我的网站标题移动?

时间:2013-09-04 07:14:54

标签: html css header position

请参阅http://www.levomedia.com/contact-us/

如果您的屏幕尺寸合适,可能没有滚动,因此您必须放大......但是当有滚动并向下移动页面时,我的主题会强制我的标题随您一起旅行,如果可能,我想删除。

阻止这种情况发生的最佳方法是什么,以便它保持在同一位置并且不随身携带?

5 个答案:

答案 0 :(得分:1)

您需要删除css属性:

position: fixed

你在标题上使用过的。

答案 1 :(得分:1)

在你的情况下,一旦你向下滚动,Js就会在topmenu中添加position:fixed属性。所以你可以通过css来做到这一点。
转换这个:

 <div id="topmenu" class="container" >

到此:

<div id="topmenu" class="container" style="position:relative !important" >

如果你不想要内联Css创建一个这样的类:

.container{
position:relative !important
}

答案 2 :(得分:1)

停止使用jquery.stickymenu.js脚本,一切都会好的。当你向下滚动页面而你不需要它时,它会应用position:fixed到你的标题。

答案 3 :(得分:1)

喜欢这个

请在.navbar-wrapper选择器

中添加position:fixed, top:0; width:100%;

和  请在此选择器中添加position:relative; top:66px; .type-post,.type-post .post,.type-page,.type-page .post

<强> CSS

   .navbar-wrapper {
    background: url("images/wild_oliva.png") repeat scroll 0 0 #EEEEEE;
    margin-bottom: 20px;
    padding-bottom: 0;
    padding-top: 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1;
}
.type-post, .type-post .post, .type-page, .type-page .post {
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    top: 66px;
}

答案 4 :(得分:1)

最好的办法就是删除导致此问题的相关Js代码。

我找到了这个

<script src="http://www.levomedia.com/wp-content/themes/sensitive/js/jquery.stickymenu.js?ver=3.6" type="text/javascript">

将js代码文件包含在您的页面中,只需删除它,everthing应该可以正常工作。

这也将改善您的页面渲染时间和效率:)

快乐编码:)