关注尚未成熟的媒体类型 [英] Caring for yet-to-come media types

查看:55
本文介绍了关注尚未成熟的媒体类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我真的希望我不会在这里遇到一个常见问题,因为

我想几乎每个作者都必须这样做决策。无论如何,这里

如下:


编写一个全局样式表会更好吗,然后为需要的媒体编写
专业版特殊待遇:


< link ... media =" all">

< link ... media =" print"> ;

< link ... media =" aural">


这可能会保证网页看起来好。在所有媒体上作者

提供了样式表,但它可能会搞乱其他媒体上的页面

类型,可能会在以后推出。

或者更好的是不写全局样式表但只支持

样式表支持的媒体


< link ... media =" screen" >

< link ... media =" print">

< link ... media =" aural">


这似乎更安全,不试图在其他媒体上渲染花式设计

类型,但这些不支持媒体会变得相当沉闷

页。

您怎么看?




Hi,

I really hope I''m not hitting a frequently asked question here, because
I think almost every author must have made that decision. Anyway, here
goes:

Would it be better to write one global stylesheet, then write
specializations for media that need special treatment:

<link ... media="all">
<link ... media="print">
<link ... media="aural">

This might guarantee that a page looks "good" on all media the author
provided stylesheets for, but it might mess up the page on other media
types, possibly introduced at some later date.
Or would it be better to write no global stylesheet but only
stylesheets for supported media

<link ... media="screen">
<link ... media="print">
<link ... media="aural">

This seems safer by not trying to render fancy design on other media
types but these "unsupported" media would then render rather dull
pages.
What do you think?

Wolf

推荐答案

Wolfgang Meier< wo *** @ sofort-mail.de>写道:
Wolfgang Meier <wo***@sofort-mail.de> wrote:
编写一个全局样式表是否更好,然后为需要特殊处理的媒体编写
专业版:

< link ... media = all>
< link ... media =" print">
< link ... media =" aural">
Would it be better to write one global stylesheet, then write
specializations for media that need special treatment:

<link ... media="all">
<link ... media="print">
<link ... media="aural">




如果你的CSS规则适合(或者很可能是b b b适合)盲文(可刷新的显示器和浮雕纸),这是有道理的。 />
手持设备,打印,投影显示,屏幕显示,语音,tty,

可以进入媒体=全部样式表。


你呢?如果没有,那么坚持使用特定于媒体的样式表。虽然你可以在

合适的时候指定多种媒体(例如,媒体=打印,投影)。

-

Darin McGrew, mc****@stanfordalumni.org http://www.rahul.net/mcgrew/

Web Design Group, da *** @htmlhelp.com http://www.HTMLHelp.com/

我曾经做过很多愚蠢的事情,但我的生活在360度左右!"



This makes sense if you''ve got CSS rules that are appropriate (or likely to
be appropriate) for braille (both refreshable displays and embossed paper),
handheld devices, print, projection displays, screen displays, speech, tty,
tv displays, and any other media types that might come along. Those rules
could go in the media="all" style sheet.

Do you? If not, then stick to media-specific style sheets. Although you can
also specify multiple media (e.g., media="print,projection") when
appropriate.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"I used to do lots of dumb things, but I turned my life around 360 degrees!"


2005年6月27日12:47:03 -0700,

" Wolfgang Meier" < WO *** @ sofort-mail.de>发表:
On 27 Jun 2005 12:47:03 -0700,
"Wolfgang Meier" <wo***@sofort-mail.de> posted:
编写一个全局样式表,然后为需要特殊处理的媒体编写
专业版会更好吗:

< link。 .. media =" all">
< link ... media =" print">
< link ... media =" aural">
Would it be better to write one global stylesheet, then write
specializations for media that need special treatment:

<link ... media="all">
<link ... media="print">
<link ... media="aural">




你也可以在样式表中做同样的事情。因此,现在引用默认样式表的所有页面

以后都可以设置为适合特定媒体,而不需要编辑页面,只需编辑

默认样式表,只要你以合理的方式创作页面

首先。


例如在页面中只链接到一个样式表。

在CSS中使用@media分隔不同的部分。


@media all {

一些常用规则...

}


@media屏幕,显示{

一些规则......

}


@media print {

一些规则...

}


当然这并不是那么高效的缓存方式(

不支持盲文的浏览器可以避免加载盲文样式表),但如果

CSS文件足够小,可能无关紧要。 MSIE获取所有CSS文件,这是我的

体验,即使它不会使用

它们(例如它获取备用样式表,但是不能使用它们。)


-

如果你坚持通过电子邮件发送给我,请使用回复地址(这是真实的,但

临时)。但请回复小组,就像你应该的那样。


这条消息是在没有病毒的情况下发送的,请自行删除一些文件。



You can do the same sort of thing in the stylesheet too. Thus, all pages
that referred to a default stylesheet now, could later be styled to suit
specific media, without needing to edit the pages, just by editing the
default stylesheet, so long as you authored the pages in a sensible manner
in the first place.

e.g. In the pages just link to one style sheet.
In the CSS use @media to separate the different sections.

@media all {
some common rules...
}

@media screen, display {
some rules...
}

@media print {
some rules...
}

Of course this isn''t brilliantly efficient cachewise (where browsers that
didn''t support braille could avoid loading a braille stylesheet), but if
the CSS file is small enough that may be immaterial. And it''s been my
experience that MSIE fetches all CSS files, even if it''s not going to use
them (e.g. it fetches alternate stylesheets, but cannot use them).

--
If you insist on e-mailing me, use the reply-to address (it''s real but
temporary). But please reply to the group, like you''re supposed to.

This message was sent without a virus, please delete some files yourself.


Tim写道:
你也可以在样式表中做同样的事情。 [...]
在CSS中使用@media分隔不同的部分。
You can do the same sort of thing in the stylesheet too. [...]
In the CSS use @media to separate the different sections.




True。我差点忘了这件事。也许我甚至可以用它来隐藏来自NN4的
花哨的CSS。


顺便说一下:我认为CSS的一大缺点是大多数属性

只有在应用_together_时才有意义,但没有办法链接

他们。考虑一下:


em {

font-style:normal;

font-weight:bold;

}


一个不支持/ font-weight /的浏览器现在会像普通文本一样呈现/ em / s
。如果支持_all_属性,只会应用

属性的块,我认为这是一个很大的改进。这个

可能导致更长的样式:


em {

颜色:红色;

}


em {

颜色:黑色;

字体样式:正常;

font-weight:bold;

}


....但要确保你得到红色,斜体/ em / s或黑色粗体,

取决于你的浏览器的功能。


只是一个想法。






True. I nearly forgot about this. Maybe I can even use this to "hide"
fancy CSS from NN4.

By the way: One big drawback of CSS, I think, is that most properties
only make sense if applied _together_, but there is no means to link
them. Consider this:

em {
font-style: normal;
font-weight: bold;
}

A browser that wouldn''t support /font-weight/ would now render /em/s
just like normal text. I''d consider it a great improvement if blocks of
properties would only applied if _all_ properties were supported. This
might lead to longer styles like this:

em {
color: red;
}

em {
color: black;
font-style: normal;
font-weight: bold;
}

....but make sure you get either red, italic /em/s or black bold ones,
depending on your browser''s capabilities.

Just a thought.

Wolf


这篇关于关注尚未成熟的媒体类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆