views:

227

answers:

3

Hi All,

I 'm a php developer. I develope a site for mobile using php hawhaw.inc.

i use the page sim for set the css for my page

as

$myPage->use_simulator("http://".$_SERVER["SERVER_NAME"].":".$_SERVER['SERVER_PORT'].dirname($_SERVER['PHP_SELF'])."/css/style.css")

im my css file i write the css for table. it set in the windows mobile but it's not set in the opera mini and black berry browsers.

The page is

$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();

the css is

/* 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;
}

if any one know please advice me for the same

Thanks in advance

A: 

there is this thing about stylesheets/ media type: how a document is to be presented on different media/

computer screens : media="screen" for prints : media="print" for mobiles : media="handheld"

if your css doesnt work, may be it needs a media attribute;

<link rel="stylesheet" type="text/css" media="handheld" href="mobile.css" />

of course its just a theory; these are other media types w3c-media

if your css work, but your table class wont;

give table different style like;

html : <table class="blabla"><tr><td></td></tr></table>

css : table.blabla{height:20px;}

or table.blabla tr td{height:20px;}

spielersun
FYI: Opera Mini uses media="screen" unless it is switched to mobile view mode (in that case it uses media="handheld").
Gerald Senarclens de Grancy
A: 

Hi spielersun

Thanks for your Answer.

i use the media="handheld" in my code

$myHtmlCode = '<1link href="css/style.css" rel="stylesheet" type="text/css" media="handheld" /><1link rel="stylesheet" type="text/css" href="css/style.css" />';

$myAdblock = new HAW_raw(HAW_HTML, $myHtmlCode); $myPage->add_raw($myAdblock);

i develope the code in haw haw for haw haw we can't add the css to table through the haw haw function. so i write the css for table

p.karuppasamy
A: 

If a page doesn't look correct in Opera Mini I suggest doing the debugging in Opera Desktop which shares the same rendering engine and offers Opera Dragonfly for debugging.

Gerald Senarclens de Grancy