By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,723 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,723 IT Pros & Developers. It's quick & easy.

<link media="screen"> and @media all

P: n/a
The page
http://w3development.de/css/hide_css...rowsers/media/
suggests using
@media all {
}
around rules to hide them from older browsers.

Suppose the above occurs in a style sheet that was linked from my
HTML via
<link media="screen" ...>

Does this create any problem. It would seem logical to me that
"@media all" is completely transparent to a user-agent that
understands it, regardless of any media specification on the <link>
tag that got us to this stylesheet in the first place.

Ai-je raison?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Stan Brown wrote:
The page
http://w3development.de/css/hide_css...rowsers/media/
suggests using
@media all {
}
around rules to hide them from older browsers.
Including MSIE 5/Mac, which is really quite good at css. So use with
caution.
Suppose the above occurs in a style sheet that was linked from my
HTML via
<link media="screen" ...>

Does this create any problem. It would seem logical to me that
"@media all" is completely transparent to a user-agent that
understands it, regardless of any media specification on the <link>
tag that got us to this stylesheet in the first place.

Ai-je raison?


Peut-etre. I'd think that only a screen ua would look in the linked
stylesheet. When it sees the @media all rule, it will of course look
inside. But no other type of agent should see it in the first place.
Is that what you meant?
--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

P: n/a
In article <kz********************@rwcrnsc52.ops.asp.att.ne t> in
comp.infosystems.www.authoring.stylesheets, Brian
<us*****@julietremblay.com.invalid-remove-this-part> wrote:
Stan Brown wrote:
The page
http://w3development.de/css/hide_css...rowsers/media/
suggests using
@media all {
}
around rules to hide them from older browsers.


Including MSIE 5/Mac, which is really quite good at css. So use with
caution.


So what's a boy to do? I've been experimenting off and on for months
now, and I don't feel any closer to a workable solution. I spent
hours and hours trying to use positioning in MSIE4 before finally
concluding it could not be made to work, so MSIE4 has to be screened
out.

I _really_ don't want to get into rule-by-rule analysis and start
using the invalid-charactrs hack on selected rules. Do you have a
viable and fairly simple recommendation?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #3

P: n/a
Stan Brown wrote:
Brian wrote:
Stan Brown wrote:
@media all { }
around rules to hide them from older browsers.


Including MSIE 5/Mac, which is really quite good at css.


So what's a boy to do?

I _really_ don't want to get into rule-by-rule analysis and start
using the invalid-charactrs hack on selected rules. Do you have a
viable and fairly simple recommendation?


I use the import trick. Not in the style declaration, but in the
linked stylesheet.

<LINK REL="stylesheet"
MEDIA="screen"
HREF="css/brian.css"
TYPE="text/css">

In brian.css is the rule

@import "screen.css" ;

Note that other import syntaxes, while conforming, don't work, in
particular with IE/Mac.

This is the best method that I've come up with, but leaves one with a
nearly empty stylesheet. In other words, I don't like it; I'd like to
use something else; but everything else seems worse.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #4

P: n/a


Stan Brown wrote:
In article <kz********************@rwcrnsc52.ops.asp.att.ne t> in
comp.infosystems.www.authoring.stylesheets, Brian
<us*****@julietremblay.com.invalid-remove-this-part> wrote:
Stan Brown wrote:
The page
http://w3development.de/css/hide_css...rowsers/media/
suggests using
@media all {
}
around rules to hide them from older browsers.


Including MSIE 5/Mac, which is really quite good at css. So use with
caution.


So what's a boy to do?


<URL:http://accessat.c-net.us/articles/hide-css_p4.html>

--
To email a reply, remove (dash)un(dash). Mail sent to the un
address is considered spam and automatically deleted.
Jul 20 '05 #5

P: n/a
In article <3f********@news.sihope.com> in
comp.infosystems.www.authoring.stylesheets, kchayka <kcha-un-
yk*@sihope.com> wrote:
Stan Brown wrote:
So what's a boy to do?
<URL:http://accessat.c-net.us/articles/hide-css_p4.html>


Thanks to you and Brian for your comments. I'm not sure I'm ready to
go to such extremes. At this point I'm leaning toward just writing
valid CSS and letting the chips fall where they may, but I want to
think about it some more.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.