Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 12th, 2006, 07:25 PM
Jarno Suni
Guest
 
Posts: n/a
Default How to give rules for choosing style sheets?

I want a device to use styles given for media type handheld and not the
styles given for media type screen, if the device supports media types
handheld and screen. Is it possible without writing all styles specified
for screen again for handheld?

--
Homepage http://www.iki.fi/jarno.suni/
  #2  
Old March 12th, 2006, 07:35 PM
Barbara de Zoete
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

On Sun, 12 Mar 2006 20:11:49 +0100, Jarno Suni <look@signature.invalid>
wrote:
[color=blue]
> I want a device to use styles given for media type handheld and not the
> styles given for media type screen, if the device supports media types
> handheld and screen. Is it possible without writing all styles specified
> for screen again for handheld?[/color]

Why not use three stylesheets then:
1. one generic with the styles you want both devices (screen and handheld)
to use, and refer to them with media 'all';
2. one specifically for screens, referring to them with media 'screen'
(possibly 'projection' too?);
3. the last one specifically for handhelds, referring to them with media
'handheld'.

Will that do?

See also <URL:http://www.w3.org/TR/REC-CSS2/media.html>

--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
  #3  
Old March 12th, 2006, 08:35 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Barbara de Zoete wrote:
[color=blue]
> Will that do?[/color]

Not well, because some handheld devices support both 'handheld' and
'screen', but I want to give totally different style for bigger 'screen'
devices, such as desktop PCs.
[color=blue]
> See also <URL:http://www.w3.org/TR/REC-CSS2/media.html>[/color]

Thanks, but I do not see how I could tell a device to use a sheet, if it
supports 'screen', but does not support 'handheld'.

--
Homepage http://www.iki.fi/jarno.suni/
  #4  
Old March 12th, 2006, 08:55 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Barbara de Zoete wrote:
[color=blue]
> Will that do?[/color]

Not well, because some handheld devices support both 'handheld' and
'screen', but I want to give totally different style for bigger 'screen'
devices, such as desktop PCs.
[color=blue]
> See also <URL:http://www.w3.org/TR/REC-CSS2/media.html>[/color]

Thanks, but I do not see how I could tell a device not to use 'screen'
styles, if it also supports 'handheld' styles.

--
Homepage http://www.iki.fi/jarno.suni/
  #5  
Old March 12th, 2006, 09:45 PM
Barbara de Zoete
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

On Sun, 12 Mar 2006 21:38:12 +0100, Jarno Suni <look@signature.invalid>
wrote:
[color=blue]
> Barbara de Zoete wrote:
>[color=green]
>> Will that do?[/color]
>
> Not well, because some handheld devices support both 'handheld' and
> 'screen', but I want to give totally different style for bigger 'screen'
> devices, such as desktop PCs.[/color]

Put the <link> to the handheld.css last in the head of your page.



--
______PretLetters:
| weblog | http://www.pretletters.net/weblog/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
  #6  
Old March 12th, 2006, 11:15 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Barbara de Zoete wrote:
[color=blue]
> Put the <link> to the handheld.css last in the head of your page.[/color]

Yes, I have done that. But, I have to remember to overwrite screen.css'
specifications in handheld.css. This makes it a little bit tricky to
maintain.

--
Homepage http://www.iki.fi/jarno.suni/
  #7  
Old March 12th, 2006, 11:25 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

...and the handheld device downloads the screen.css for nothing.

--
Homepage http://www.iki.fi/jarno.suni/
  #8  
Old March 13th, 2006, 10:25 AM
Carolyn Marenger
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Jarno Suni wrote:
[color=blue]
> Barbara de Zoete wrote:
>[color=green]
>> Put the <link> to the handheld.css last in the head of your page.[/color]
>
> Yes, I have done that. But, I have to remember to overwrite screen.css'
> specifications in handheld.css. This makes it a little bit tricky to
> maintain.[/color]

Welcome to the world of catch 22s. The handheld manufacturer probably set
up their device to accept media type screen due to a general lack of
websites supporting the handheld media type. Now we are faced with
additional work to handle the situation.

To the best of my knowledge, you are stuck with having to rewrite the entire
style sheet for the second media type.

Carolyn
--
Carolyn Marenger

  #9  
Old March 13th, 2006, 10:25 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Carolyn Marenger wrote:
[color=blue]
> To the best of my knowledge, you are stuck with having to rewrite the entire
> style sheet for the second media type.[/color]

Couldn't W3C add a way to exclude a style to the recommendation, if
device supports some media type:
e.g.
<LINK rel="stylesheet" type="text/css"
media="screen, -handheld" href="real_screen.css">
would give order to use real_screen.css, if device supports 'screen' AND
does NOT support 'handheld'. This wouldn't help the users of old
browsers. BTW Can you update the browser of old mobile phone?

--
Homepage http://www.iki.fi/jarno.suni/
  #10  
Old March 13th, 2006, 10:35 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Jarno Suni wrote:[color=blue]
> ..and the handheld device downloads the screen.css for nothing.
>[/color]
... which would cost some extra money & time to someone who is browsing.

--
Homepage http://www.iki.fi/jarno.suni/
  #11  
Old March 13th, 2006, 10:35 PM
Carolyn Marenger
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Jarno Suni wrote:
[color=blue]
> Carolyn Marenger wrote:
>[color=green]
>> To the best of my knowledge, you are stuck with having to rewrite the
>> entire style sheet for the second media type.[/color]
>
> Couldn't W3C add a way to exclude a style to the recommendation, if
> device supports some media type:
> e.g.
> <LINK rel="stylesheet" type="text/css"
> media="screen, -handheld" href="real_screen.css">
> would give order to use real_screen.css, if device supports 'screen' AND
> does NOT support 'handheld'. This wouldn't help the users of old
> browsers. BTW Can you update the browser of old mobile phone?[/color]

The answer to that is possibly. If you want it, contact w3c and get on
their advisory panel, or at least recommend it to them stating your
justifications. It still becomes an issue for the browser writers to deal
with. Regardless what the standard is, they can always decide to ignore
it. Ultimate decision would probably be based on their sales.

Updating browsers in mobile phones? Contact the manufacturer for that. My
guess is they won't bother, since their focus seems to be make a new model
with new features and sell it to everyone who bought the old and outdated
model. Logical does not always equate with making money.

Carolyn
--
Carolyn Marenger

  #12  
Old March 14th, 2006, 12:55 AM
kchayka
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Jarno Suni wrote:[color=blue]
> Jarno Suni wrote:[color=green]
>> ..and the handheld device downloads the screen.css for nothing.
>>[/color]
> .. which would cost some extra money & time to someone who is browsing.[/color]

Blame the hand-held browser makers for accepting screen media in the
first place. I don't know what they were thinking...

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
  #13  
Old March 14th, 2006, 06:05 PM
Jarno Suni
Guest
 
Posts: n/a
Default Re: How to give rules for choosing style sheets?

Carolyn Marenger wrote:
[color=blue]
> To the best of my knowledge, you are stuck with having to rewrite the
> entire style sheet for the second media type.[/color]

I got an idea from the HTML 4.01 Specification, Chapter 14 [1] and tried
to define two preferred style sheets inside <head> section:
<link rel="stylesheet" type="text/css" title="pref" media="handheld"
href="handheld.css" />
<link rel="stylesheet" type="text/css" title="pref" media="screen"
href="screen.css" />

According to the chapter 14.4.1: "Both LINK and STYLE may be used with
the media attribute. The user agent is then responsible for filtering
out those style sheets that do not apply to the current medium." On the
other hand, a standard handheld medium should not use screen.css, if it
supports handheld media type, since in chapter 14.3.2 it is told that
"If two or more LINK elements specify a preferred style sheet, the first
one takes precedence."

Unfortunately, the XHTML browser of the mobile phone I use, does not
follow these rules; it uses both style sheets. I tried to change the
title of the second link tag, but it did not help; in the contrary
Firefox 1.5 uses neither of the style sheets then.

[1] http://www.w3.org/TR/html4/present/styles.html

--
Homepage http://www.iki.fi/jarno.suni/

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles