【发布时间】:2018-04-03 23:48:17
【问题描述】:
我花了几个小时寻找解决方案,但我找不到。
我有简单的应用程序,使用 jQuery mobile + Phonegap,我想在 CONTENT 部分放置背景图片,
这是我的代码。
html, body {
height: 100%;
}
#mainn {
height: 100%;
}
#mainn .ui-header {
height: 40px;
}
#ctn {//CONTENT Style
background:url(backimage.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-witdh:100%;
min-height:100%;
}
<div data-role="page" id="mainn" data-position="fixed">
<div data-role="header" data-tap-toggle="false" data-theme='b'>
<a href='#sidebar' data-role="none" id="a-sidebar"><img src="images/menu-icon.png" alt="sidebar" id="header-menu-icon" /></a>
<h1 class="header-title">My Aps</h1>
</div>
<div data-role="content" id="ctn">
content
</div>
<div data-role="footer" data-position="fixed" ></div>
</div>
【问题讨论】:
-
尝试使用
background-size: 100% 100%;
标签: jquery css jquery-mobile