Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 482
Registered: ‎10-24-2008
My Device: 9300
My Carrier: AT&T
Accepted Solution

CSS media queries

Do OS 5 & 6 browsers both support CSS media queries? I'm trying to create separate style sheets for a Torch, Bold (9700), and a Curve (9300). 

 

http://forabeautifulweb.com/blog/about/hardboiled_css3_media_queries/

_________________________________________
www.jasonmace.com/blackberry
Developer
Posts: 185
Registered: ‎08-17-2008
My Device: Red BlackBerry Z10
My Carrier: Vodafone

Re: CSS media queries

Jason,

 

you can try with something like this. 

 

sCSS it's the string name of the CSS, so you can create different files based on BlackBerry model or BlackBerry device Width.

 

so sCSS can be for example: stylesheet9700.css, stylesheet9300.css,... or stylesheet480.css, stylesheet360.css, ..

 

 

var oLink = document.createElement("link") 
oLink.href = sCSS; 
oLink.rel = "stylesheet"; 
oLink.type = "text/css"; 
document.body.appendChild(oLink);

 All the best

 

Josep Maria
Developer
Posts: 482
Registered: ‎10-24-2008
My Device: 9300
My Carrier: AT&T

Re: CSS media queries

thanks miamon,

 

great "lazy evaluation" technique.

_________________________________________
www.jasonmace.com/blackberry