javascript - 为什么背景图片不显示?

标签 javascript angularjs html css ionic-framework

我正在尝试制作简单的应用程序单页应用程序。实际上,当我使用 <ion-content class="bg" style="position:absolute!important"> 时,我拍摄了放置在 上的背景图像。 position:absolute 但是它显示在小区域。我需要在整个竞争中显示。换句话说在整个竞争标签完整屏幕中。 这是我的代码

http://codepen.io/anon/pen/pvYdNM

<html ng-app="ionicApp">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>Ionic List Directive</title>

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
  </head>

  <body >
        <ion-view>
      <ion-header-bar class=" bar bar-positive ">
      <h1 class="title">Title!</h1>    

      </ion-header-bar>
      <ion-content class="bg"  style="position:absolute!important">
          <h1 >contend</h1>
          </ion-content>
          <ion-footer-bar class=" bar bar-footer bar-positive" style="position:fixed!important">
           <h1 class="title">Fotter!</h1>
          </ion-footer-bar>
      </ion-view>



  </body>
</html>

最佳答案

只要告诉它它应该有多大。

类似于:

<ion-content class="bg"  style="position:absolute; left: 0; right: 0; top: 43px; bottom: 43px;">

应该可以。

关于javascript - 为什么背景图片不显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29329519/

相关文章:

django - 即使在登录后,Tastypie 请求也显示匿名用户

jquery - 如何阻止过渡在图片库中跳动?

javascript - 在 Scroll 上移动 Div,然后停留在那里(水平粘条)

javascript - Firebase 离线缓存 & 原始 firebase.js 源代码

javascript - 如何在 Javascript 中的 html 编码中正确使用 .click 选择类型?

javascript - 在 ng-click 中传递变量

Angularjs:ng-bind-html 和 ng-repeat

php - angularjs:如何在指令中使用 if-else 条件

javascript - 从日期中添加/减去天数不会正确更改年/月

javascript - 单击另一个扰流板时关闭扰流板