我是一名php开发人员。我使用php hawhaw.inc开发了一个移动网站。
我使用页面sim为我的页面设置css
as
$myPage->use_simulator("http://".$_SERVER["SERVER_NAME"].":".$_SERVER['SERVER_PORT'].dirname($_SERVER['PHP_SELF'])."/css/style.css")
我的css文件我写了表的css。它设置在windows mobile中,但它没有设置在opera mini和black berry浏览器中。
页面是
$myPage = new HAW_deck("Login ", HAW_ALIGN_CENTER);
/*$myPage->set_bgcolor('#337fa6');
$myPage->set_background('../images/body_bg.jpg');
$myPage->set_css_class('skin');*/
$myHtmlCode = '<link href="css/style.css" rel="stylesheet" type="text/css" media="handheld" /><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="viewport" content="initial-scale=1.0"/><meta name="viewport" content="user-scalable=false" />';
$myAdblock = new HAW_raw(HAW_HTML, $myHtmlCode);
$myPage->add_raw($myAdblock);
/*$myPage->set_width('50%');
$myPage->set_height('50%');*/
$myPage->use_simulator("http://".$_SERVER["SERVER_NAME"].":".$_SERVER['SERVER_PORT'].dirname($_SERVER['PHP_SELF'])."/css/style.css");
$myForm = new HAW_form($_SERVER['PHP_SELF']);
$text = new HAW_text("Please enter username & password:");
$text1 = new HAW_text("REMcloud", HAW_TEXTFORMAT_BOLD | HAW_TEXTFORMAT_BIG);
$myImage1 = new HAW_image('','../images/logo.png','REMcloud','');
$myImage1->set_br(1);
$myImage1->set_html_width(200);
$myImage1->set_html_height(100);
$error=new HAW_text($_REQUEST['msg'], HAW_TEXTFORMAT_BOLD);
$error->set_color("#ff0000", "red");
$theID = new HAW_input("username", "", "Username", "*N");
$theID->set_size(4);
$theID->set_maxlength(20);
$text2 = new HAW_text("");
$thePW = new HAW_input("password", "", "Password", "*N");
$thePW->set_size(4);
$thePW->set_maxlength(20);
$thePW->set_type(HAW_INPUT_PASSWORD);
$theSubmission = new HAW_submit("Submit", "submit");
// add the elements in the form
//$myForm->add_text($text1);
$myForm->add_image($myImage1);
//$myForm->add_text($text2);
$myForm->add_text($error);
$myForm->add_text($text2);
$myForm->add_text($text);
$myForm->add_text($text2);
$myForm->add_input($theID);
$myForm->add_text($text2);
$myForm->add_input($thePW);
$myForm->add_text($text2);
$myForm->add_submit($theSubmission);
$myPage->add_form($myForm);
$myPage->create_page();
css是
/* HAWHAW skin stylesheet for the hawhaw phone */
body {
background-color: #FFFFFF;
text-align: center;
margin: 0px;
padding: 0px;
color: #222222;
}
#skin {
margin: 0px auto;
padding: 0px;
text-align: left;
width: 280px;
height: 466px;
background-image: url(../../images/bg.jpg);
background-color:#337fa6;
background-repeat:repeat-x;
}
#display {
position: relative;
top: 80px;
/* left: 43px;*/
width: 100%;
height: 85%;
overflow: auto;
}
TABLE{
width:100%;
padding-left:-10px;
overflow:scroll;
height:20px;
border:none;
font-family:Calibri;
font-size:14px;
}
tr{
height:20px;
}
td{
color:#fff;
border:none;
}
a
{
font-family:Calibri;
font-size:16px;
}
如果有人知道,请为我提供相同的建议
提前致谢
答案 0 :(得分:0)
有关于样式表的事情/ 媒体类型:文档如何在不同媒体上展示/
电脑屏幕:media =“screen” 用于打印:media =“print” 适用于手机:media =“掌上电脑”
如果您的CSS不起作用,可能需要媒体属性;
<link rel="stylesheet" type="text/css" media="handheld" href="mobile.css" />
当然只是一个理论;这些是其他媒体类型w3c-media
如果你的css工作,但你的桌子类不会;
给表格不同的样式;
html:<table class="blabla"><tr><td></td></tr></table>
css:table.blabla{height:20px;}
或table.blabla tr td{height:20px;}
答案 1 :(得分:0)
如果Opera Mini中的页面看起来不正确,我建议在Opera Desktop中进行调试,共享相同的渲染引擎并提供Opera Dragonfly进行调试。
答案 2 :(得分:0)
或者您可以使用它来检查Opera mini的实际兼容性
Opera mini在Web标准方面存在很多问题,希望对您有所帮助。