W3C home > Mailing lists > Public > www-style@w3.org > July 2004

Re: @media in style attribute

From: Tantek Çelik <tantek@cs.stanford.edu>
Date: Thu, 01 Jul 2004 17:38:53 -0700
To: Philip Hoyt <phoyt@macbox.com>, <www-style@w3.org>
Cc: Ada Chan <adachan@microsoft.com>
Message-ID: <BD09FC71.48F4A%tantek@cs.stanford.edu>

On 5/19/04 1:59 PM, "Philip Hoyt" <phoyt@macbox.com> wrote:

> 
> I've been trying to find a way to specify media type for a css rule in
> the style attribute of xhtml. Something like
> <img src="printLogo.gif" style="@media print {display: block} @media
> screen {display:none}" /> but this doesn't seem to be part of any
> specfication, and at least that syntax doesn't work in any modern
> browsers. Seems like it might be useful functionality.

I agree it would be useful functionality.

It is not implemented in any modern browser AFAIK either.

However, the syntax (thus capability) *is* in a draft specification:

 http://www.w3.org/TR/css-style-attr

Which could benefit by being updated to include the example you gave, and
perhaps adding that construct to the "Pseudo-rules 'style' attribute
profile":

 http://www.w3.org/TR/css-style-attr#pseudo-rules

Tantek
Received on Thursday, 1 July 2004 20:38:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:31 GMT