我正在 phonegap 中设计应用程序。
我在外部包含了以下 CSS:
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css" />
<link rel="stylesheet" href="css/bootstrap.min.css">
在设计中我希望 body 有一张背景图片。
为此我做了以下工作:
<style>
/*this block should go in the styles.css file*/
.ui-panel-inner {
padding:0px; /*make the buttons flush edge to edge*/
}
.ui-controlgroup {
margin:0; /*make the buttons flush to the top*/
}
#header {
height:54px;
}
#bars-button {
margin:7px;
}
.bodyCSSBG
{
background-image:url("ProjectImages/aboutUsBackground.JPG");
background-repeat:no-repeat;
background-size:cover;
}
</style>
在正文中:
<body class="bodyCSSBG">
但是背景图片没有应用到页面。
如果我删除外部 css 为:
<link rel="stylesheet" href="css/jquery.mobile-1.3.1.min.css" />
然后应用背景图像。
在这种情况下我能做什么??
编辑 1:
写成 !Important 为:
最佳答案
使用
!重要
.bodyCSSBG
{
background-image:url("ProjectImages/aboutUsBackground.JPG") !important;
background-repeat:no-repeat;
background-size:cover;
}
关于javascript - 由于外部 css 包含,css 未被应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27292937/