Cordova 在phonegap中设置背景图像 #bgImage{ 背景图片:url(“/MedicineAlert/res/drawable hdpi/bgimage.png”); 背景大小:100%100%; 背景重复:无重复; 背景位置:100%100%; 顶部:0px; 左:0px; } .formButton{ 字体系列:Verdana,日内瓦,无衬线; 字体大小:24px; 颜色:#FFF; 填充:5px10px 5px10px; 边框:实心1px#CCC; 背景:#ba4742; 文本阴影:0px 1px 0px#000; 边界半径:5px; -moz边界半径:5px; -webkit边界半径:5px; 盒影:0 1px 3px#111; -莫兹盒阴影:3px 3px 1px#999; -网络工具包盒影:3px 3px 1px#999; 光标:指针; } .formButton:悬停{ 背景:#a33f3a; } 警报时间 请填写表格并提交 请提供您的信息! 名字 中间名 姓氏 出生日期 社会保险号码 性别男性 女性
我很难访问我的可绘制hdpi文件夹中的图像。首先,我在assets文件夹中创建了一个名为image的文件夹,然后我尝试使用css引用位于assets目录中的image文件夹中的图像,但没有成功。我决定使用可提取的资源,但我仍然有同样的问题。有什么帮助吗 将图像放回assets/www文件夹,可能放在名为images的文件夹中,并按如下方式访问它: 背景图片:url(“images/bgimage.png”) 这应该行得通 你能告诉我你的内联css应该在html文档的head元素中,并用Cordova 在phonegap中设置背景图像 #bgImage{ 背景图片:url(“/MedicineAlert/res/drawable hdpi/bgimage.png”); 背景大小:100%100%; 背景重复:无重复; 背景位置:100%100%; 顶部:0px; 左:0px; } .formButton{ 字体系列:Verdana,日内瓦,无衬线; 字体大小:24px; 颜色:#FFF; 填充:5px10px 5px10px; 边框:实心1px#CCC; 背景:#ba4742; 文本阴影:0px 1px 0px#000; 边界半径:5px; -moz边界半径:5px; -webkit边界半径:5px; 盒影:0 1px 3px#111; -莫兹盒阴影:3px 3px 1px#999; -网络工具包盒影:3px 3px 1px#999; 光标:指针; } .formButton:悬停{ 背景:#a33f3a; } 警报时间 请填写表格并提交 请提供您的信息! 名字 中间名 姓氏 出生日期 社会保险号码 性别男性 女性,cordova,Cordova,我很难访问我的可绘制hdpi文件夹中的图像。首先,我在assets文件夹中创建了一个名为image的文件夹,然后我尝试使用css引用位于assets目录中的image文件夹中的图像,但没有成功。我决定使用可提取的资源,但我仍然有同样的问题。有什么帮助吗 将图像放回assets/www文件夹,可能放在名为images的文件夹中,并按如下方式访问它: 背景图片:url(“images/bgimage.png”) 这应该行得通 你能告诉我你的内联css应该在html文档的head元素中,并用 #bgI
#bgImage{
background-image:url("/MedicineAlert/res/drawable-hdpi/bgimage.png");
background-size: 100% 100%;
background-repeat:no-repeat;
background-position:100% 100%;
top: 0px;
left: 0px;
}
.formButton{
font-family: Verdana, Geneva, sans-serif;
font-size: 24px;
color: #FFF;
padding: 5px 10px 5px 10px;
border: solid 1px #CCC;
background: #ba4742;
text-shadow: 0px 1px 0px #000;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
box-shadow: 0 1px 3px #111;
-moz-box-shadow: 3px 3px 1px #999;
-webkit-box-shadow: 3px 3px 1px #999;
cursor: pointer;
}
.formButton:hover {
background: #a33f3a;
}
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Alert Time</title>
<link rel="stylesheet" href="register.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
<script type="text/javascript" charset="utf-8" src="register.js"></script>
</head>
<body id="bgImage">
<hearder>
<h1>Please fill out the form and submit</h1>
</header>
<div>
<form action="" method="post">
<header>
<h1>
Your information Please!
</h1>
</header>
<div>
<form id="form_info" action="" method="post">
Fist Name <input type="text" name="fname" required="required" /><br />
Middle Name <input type="text" name="mname" /><br />
Last name <input type="text" name="lname" required="required" /><br />
Date of birth <input type="text" name="dOfBirth" required="required"/><br />
Social security Number <input type="text" name="sNumber" /><br />
Gender <label for="male">Male</label>
<input type="radio" name="sex" id="male" />
<label for="female">Female</label>
<input type="radio" name="sex" id="female" />
</div><br />
<input type="submit" name="submitButton" value="Submit" class="formButton" />
</form>
</div>
</body>
</html>
部署应用程序时内部使用的路径与您在项目结构中看到的路径不同。试一试
<style></style>
对于资产/图像,使用
background-image:url("file:///android_res/drawable/bgimage.png");
这些文件夹是否位于www文件夹中?嗨,Clinton Ward,我创建的图像文件夹位于www文件夹中,而drawable文件夹位于res文件夹中。我首先在www文件夹中创建了图像文件夹,但无法访问图像,然后我决定使用rge res文件夹中的可绘制文件夹。如何在ios中访问它?
background-image:url("file:///android_asset/image/bgimage.png");