mui-设置背景图片

2016-4-10 admin CSS

CSS样式

 

#body-background {
 /*height: 411px;*/
 background-image: url(../images/about-bg.png);
 background-repeat: no-repeat;
 background-size: 100% 100%;
}

 

HTML

 

 

 <body>
  <header class="mui-bar mui-bar-nav">
   <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
   <h1 class="mui-title">关于饿了么</h1>
  </header>
  <div class="mui-content">
   <div id="body-background">
    1
   </div>
  </div>
  <script type="text/javascript" src="js/castapp.js"></script>
  <script>
   castapp.init();
   var oWidth = document.documentElement.clientWidth || document.body.clientWidth;
   var oHeight = document.documentElement.clientHeight || document.body.clientHeight;
   var oDiv = document.getElementById('body-background');
   oDiv.style.height = (oHeight - 44) + 'px';
  </script>
 </body>

 

评论(0) 浏览(1964)

Powered by emlog 吉ICP备15003877号