基本上,我正在尝试设置背景颜色(或图像)。我写在HTML CSS和JQuery移动。
我正在尝试创建一个基本的AppMobi应用程序,但我似乎无法在下面的示例中更改我的背景:
<div data-role="page" id="page">
<div data-role="header" data-theme="c">
<h1>Page One</h1>
</div>
<div data-role="content" data-theme="c">
<ul data-role="listview" data-theme="b">
<li><a href="#page2">Page Two</a></li>
<li><a href="#page3">Page Three</a></li>
<li><a href="#page4">Page Four</a></li>
<li><a href="#page3" data-role="button" data-icon="delete">Delete</a></li>
</ul>
</div>
<div data-role="footer" style="position:fixed; bottom:0;" data-theme="c">
<h4>Page Footer</h4>
</div>
</div>我尝试过在HTML和CSS中更改背景,但似乎无法更改页面1的背景颜色(示例)。页面1包括4个按钮和一个“粘性页脚”。按钮显示在屏幕顶部,但按钮或列表与页脚之间的内容不会改变颜色。我尝试在标题和内联中编写HTML或CSS。
我怎样才能改变这个“div”块的背景颜色呢?
提前感谢
发布于 2011-10-03 07:28:11
你的问题与移动无关,而是与JQuery AppMobi有关。
JQuery手机的工作方式是加载内容,然后“处理”它并应用样式。正在发生的事情是,CSS正在覆盖您的默认JQuery样式。打开JQuery Mobile CSS文件并在其中进行更改。
发布于 2011-09-30 22:17:54
在标准的示例应用程序中,下面是index.html中设置背景的代码块。
/* Set up the page with a default background image */
body {
background-color:#fff;
color:#000;
font-family:Arial;
font-size:48pt;
margin:0px;padding:0px;
background-image:url('images/background.jpg');
}您可以看到,它只是设置了位于图像目录中的标题为background.jpg的图像。
<style type="text/css">
* { -webkit-user-select:none; -webkit-tap-highlight-color:rgba(255, 255, 255, 8); }
input, textarea { -webkit-user-select:text; }
body
{
font-family:Arial;font-size:24pt;font-weight:bold;
background:
-webkit-gradient(radial, 50% 60%, 0, 53% 50%, 50, from(rgba(255,255,255,0)), color-stop(99%,rgba(255,255,255,.15)), to(rgba(255,255,255,0))),
-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, from(rgba(255,255,255,0)), color-stop(99%,rgba(255,255,255,.1)), to(rgba(255,255,255,0))),
-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 200, from(rgba(255,255,255,0)), color-stop(99%,rgba(255,255,255,.1)), to(rgba(255,255,255,0))),
-webkit-gradient(radial, 40% 50%, 0, 40% 55%, 25, from(rgba(255,255,255,0)), color-stop(99%,rgba(255,255,255,.1)), to(rgba(255,255,255,0))),
-webkit-gradient(linear, 0% 0%, 0% 100%, from(#8D4212), to(#28580C), color-stop(.5,#DA881B));
background-size: 400px 400px, 470px 470px, 600px 600px, 300px 300px, 100% 100%;
background-color: #28580C;
}
</style>所以你应该能够给你的Page1 div一个id,然后把图片或者其他你想要的东西应用到这个div id上。
https://stackoverflow.com/questions/7611451
复制相似问题