12-17-2010 04:32 AM
We have a booking on line system, we are trying to develop a blackberry version but we are not able to display correctly css. In simulator browser everything works normally.
Please take a look at www.grottagiustispa.com: when you try to check availability the css isn't loaded, but it is the same as the first page. What's wrong?
Solved! Go to Solution.
12-17-2010 09:35 AM
Which version of the BlackBerry device software are you seeing this behavior? I tested your link on BlackBerry 6 and the availability page works looks like it has CSS being applied to it.
I notice that the <link> element on this page is linking to a *.php file instead of a *.css page. Is that your intent? I will have to confirm, however I believe that older versions of the BlackBerry browser disallow PHP files from being used in this manner.
12-17-2010 03:55 PM
I reproduced the behavior you've described using a BlackBerry Pearl 9100 running 184.108.40.2064.
This tells me that OS 5.0 is not able to recognize the style sheet (actually a PHP disguised as a CSS file) you are referencing from this page. Reasons for this could have to do with content transcoding (performed by the MDS component of the BlackBerry Web Infrastructure which is used when using the Internet Browser or BlackBerry Browser configuration option) or that the MIME type for this content is incorrect.
As a way of verifying this, can you try the following?
1) Open the Options menu, and change the "Browser" field in "Browser Configuration" to a value other than 'BlackBerry Browser' or 'Internet Browser' and reload the page. If you see the CSS renders correctly, the issue has to do with transcoding and the solution is to change your page to use an actual CSS file, rather than a disguised PHP file.
2) Can you verify that your PHP page that is dumping out CSS content is also setting its content type to "text/css"? If not, try doing this, and then reloading the site. If the CSS renders correctly, then this has solved the problem. See this page for how to set page content type in PHP: http://php.net/manual/en/function.header.php