This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Defining CSS for Blackberry and PC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Defining CSS for Blackberry and PC" Watch "Defining CSS for Blackberry and PC" New topic
Author

Defining CSS for Blackberry and PC

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
How can I have 2 CSSs on a page that formats for a browser on a PC and one for formatting for a handheld device (in this case Blackberry)? Any info would be appreciated. Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Hint: media type


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
Didn't work. I already tried setting styles for media "all" for some items on the page and then tried setting a few of the same styles for the same items using "handheld" and it didn't work (~ blackberry).
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 815
I should also add that it wasn't the only way I tried it - left one stylesheet as is (without a media assigned) and one for handheld. I also tried setting media to "print handheld" and that didn't work. I tried a few things without success.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Rob,
As of January, BlackBerry didn't like media types. There are some hacks, but they aren't very pleasant. See Approach #1 in my JavaRanch forums go mobile blog entry. It contains a bit of analysis and a link to the site with the hacks.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Defining CSS for Blackberry and PC
 
Similar Threads
Android vs BlackBerry
Need help on JQUERY/AJAX support with Blackberry Simulator 9700
what is casira test board?
Outsource Android/BB development from China
why is iphone popular ?