在cordova固定标头

时间:2016-04-19 20:38:32

标签: html css cordova

我试图将我的标题修复到顶部,这样如果用户滚动到列表,搜索输入字段和标题栏将保持在屏幕顶部。但是目前标题会随着正文中的内容向上滚动...

这就是我所拥有的:

<body ng-controller="SearchCtrl" class="animated fadeIn">
    <div class="bar bar-header fixed bar-assertive" style="padding-bottom: 20px;">
      <a href="index.html"class="button icon-left ion-chevron-left smaller button-clear button-white"></a>
          <h1 class="title">Suche</h1>
      </div>
      <label class="item item-input has-header fixed" style="margin-top: 5px;">
      <input type="text" placeholder="Solothurn durchsuchen..." name="text" ng-model="searchBox.storeName">
    </label>
    <br> 

固定类是:

position: fixed;

任何帮助非常感谢!

1 个答案:

答案 0 :(得分:1)

只是为了测试它,将!important添加到你的css固定类中。您的其他一个类可能会覆盖/级联它。如果它修复了它,那么您需要在样式表中执行某些操作,以使position: fixed规则优先于正在应用的其他位置规则,这样您就可以删除!important,因为它更清晰,如果CSS第一次正确级联,则更轻。