多个链接的样式表 [英] Multiple linked stylesheets

查看:95
本文介绍了多个链接的样式表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚回答了一个关于多个链接样式表的问题,我认为我会看看浏览器的支持。


There'a快速测试页面:

http://www.porjes。 com / ms /

我是根据我的理解写的:

http://www.w3.org/TR/html401/present....html# h-14.3.2


Mozilla按我的预期工作。 Opera有时会像我期望的那样工作(即

将网址粘贴到导航栏并点击返回工作直到重新加载)。

IE6似乎一无所知。


有什么想法吗?我在任何地方都犯了错误吗?

解决方案

在文章< MP ***************** *******@news.CIS.DFN.DE>,
po **** @ spamcop.net 说...

刚刚回答了关于多个链接样式表的问题,我想我会看一下浏览器支持。

那里这是一个快速测试页面:

http:// www .porjes.com / ms /

我是根据我的理解写的:

http://www.w3.org/TR/html401/present....html#h -14.3.2

Mozilla按我的预期工作。 Opera有时会像我期望的那样工作(即将网址粘贴到导航栏并点击返回工作直到重新加载)。
IE6似乎一无所知。



刚注意到一个小小的翘起,现在已经修好了。 Opera现在按预期工作,

并应用备用样式表。 IE6选择首选的表格

罚款,但显然不会在没有javascript的情况下进行备用。


" Jacqui或(也许)Pete" ; < PO **** @ spamcop.net>在留言中写道

新闻:MP ************************ @ news.CIS.DFN.DE ......

是的,我认为这很令人困惑。取决于标题和
rel,有''首选',
''执行''和''替代''样式表。请注意,两个样式表可以具有相同的标题,在这种情况下
它们都应该适用。
....这背后的想法是你有一个首选的样式表和几个备选的样式表,读者可以选择(他们可以,给予一个足够先进的浏览器或触摸javascript)。




进一步阅读,真正令人困惑的部分是

真的只有两种类型(不是三种) :持久和交替。 ''首选'是

替代的子类型(即,*是*替代)。 ListApart文章

具有误导性。 W3C的建议更加明确。由于替代

样式表是互斥的,因此您一次只能拥有一个(或一个名为

的工作表组)。 =(


这给我带来了一些问题,除非我只是想到这一切都错了。我正在一个网站上工作6个不同的表(2个持续[一个用于

屏幕,一个用于打印],1个替代用于大字体,3个替换用于

''皮肤'')。我会就像bigfonts表和任何

的皮肤一起工作一样,但由于它们都是备用表,我显然只有

一次只有一个。这很糟糕。


应该发生什么(至少我想要发生的事情)是你来到

网站并获得'正常''布局(持久的表格和皮肤#1

[首选的替代]结合)。如果你的视力受损,你可以

理想地选择大字体并仍然保持皮肤#1。从那里,你可以

选择皮肤#2或#3,同时仍然保持大字体(大字体表格

取代persista nt表格的字体大小)。


现实中发生的事情,至少就目前来说,如果你选择

largefonts,你会失去皮肤,和/或反之亦然。


有没有人知道解决这个问题的方法?我已经考虑过将
皮肤与大字体组合在一起,但这会增加用户必须趟过的用户数量 - (皮肤#1正常,皮肤#1

大字体,皮肤#2正常,皮肤#2大字体等等)


只需向用户呈现正常情况会很好或大字体,

和他们选择的皮肤。换句话说,如果W3C将b $ b带走相互排斥的话会很好。规则,让你在无限制的替代工作表(或广告恶作剧)上叠加替代工作表

。 =)


- Richard


文章< MP ********* ***************@news.CIS.DFN.DE>在

comp.infosystems。 www.authoring.stylesheets ,Jacqui或者(也许)Pete

< po **** @ spamcop.net>写道:

刚刚回答了关于多个链接样式表的问题,我想我会看看浏览器支持。

快速测试页面:

http://www.porjes.com / ms /




谢谢!这是我一直有意义的事情,因为我想

切换_print_ stylesheets。现在你已经完成了我的腿部工作,而且我可以从你的辛勤工作中捞出
。 < grin>


还要感谢
http://www.alistapart.com/stories/alternate/


http://www.w3.org/TR/html401/present....html #h-14.3.2


-

Stan Brown,Oak Road Systems,美国纽约州科特兰县
http://OakRoadSystems.com/

HTML 4.01规范:< a rel =nofollowhref =http://www.w3.org/TR/html401/target =_ blank> http://www.w3.org/TR/html401/

验证者: http://validator.w3.org/

CSS 2规范: http:// www。 w3.org/TR/REC-CSS2/

验证人: http://jigsaw.w3.org/css-validator/


Having just answered a question about multiple linked stylesheets, I
thought I''d have a look at browser support.

There''s a quick test page here:

http://www.porjes.com/ms/

I wrote it according to my understanding of:

http://www.w3.org/TR/html401/present....html#h-14.3.2

Mozilla works as I expected. Opera sometimes works as I expect (ie
pasting the url into the nav bar & hitting return works until reload).
IE6 seems clueless.

Any thoughts? Have I made a mistake anywhere?

解决方案

In article <MP************************@news.CIS.DFN.DE>,
po****@spamcop.net says...

Having just answered a question about multiple linked stylesheets, I
thought I''d have a look at browser support.

There''s a quick test page here:

http://www.porjes.com/ms/

I wrote it according to my understanding of:

http://www.w3.org/TR/html401/present....html#h-14.3.2

Mozilla works as I expected. Opera sometimes works as I expect (ie
pasting the url into the nav bar & hitting return works until reload).
IE6 seems clueless.


Just noticed a small cock-up, now fixed. Opera now works as expected,
and applies alternate stylesheets. IE6 picks up the preferred sheet
fine, but obviously won''t do alternate without javascript.


"Jacqui or (maybe) Pete" <po****@spamcop.net> wrote in message
news:MP************************@news.CIS.DFN.DE...

Yeah, I think it''s pretty confusing. There are ''preferred'',
''persistent'', and ''alternate'' stylesheets depending on the title and
rel. Note that two stylesheets can have the same title in which case
they should both apply. .... The idea behind this is that you have one preferred stylesheet and a few
alternate ones that the readers can select (which they can, given a
sufficiently advanced browser or a touch of javascript).



Upon further reading, the part that is really confusing is that there are
really only two types (not three): persistant and alternate. ''Preferred'' is
a subtype of alternate (i.e., it *is* an alternate). The ListApart article
is misleading. The W3C recommendation is more clear. Since alternate
stylesheets are mutually exclusive, you can only have one (or one named
group of sheets) at a time. =(

This causes several problems for me, unless I''m just thinking about this all
wrong. I''m working on a site with 6 different sheets (2 persistant [one for
screen, one for print], 1 alternate for largefonts, and 3 alternates for
''skins''). I would like the largefonts sheet to work in conjunction with any
of the skins, but since they''re all alternate sheets, I can apparently only
have one at a time. That sucks.

What should happen (at least what I want to happen) is that you come to the
site and get the ''normal'' layout (the persistant sheet and skin #1
[preferred alternate] combined). If you''re visually impaired, you could
ideally select "largefonts" and still keep skin #1. From there, you could
choose skin #2 or #3 while still keeping largefonts (the largefonts sheet
supercedes the persistant sheet for font sizes).

What''s happening in reality, at least for now, is that if you choose
largefonts, you lose the skin, and/or vice versa.

Does anyone know a way around this? I''ve already thought about grouping
skins together with largefonts, but that multiplies the number of user
options that they have to wade through - (skin #1 normal, skin #1
largefonts, skin #2 normal, skin #2 largefonts, etc.)

It would be nice to just present the user with either normal or largefonts,
and their choice of skin. In other words, it would be nice if the W3C would
take away the "mutually exclusive" rule, and let you stack alternate sheet
upon alternate sheet ad infinitum (or ad nauseum). =)

-- Richard


In article <MP************************@news.CIS.DFN.DE> in
comp.infosystems.www.authoring.stylesheets, Jacqui or (maybe) Pete
<po****@spamcop.net> wrote:

Having just answered a question about multiple linked stylesheets, I
thought I''d have a look at browser support.

There''s a quick test page here:

http://www.porjes.com/ms/



Thanks! It''s something I keep meaning to do, because I want to
switch _print_ stylesheets. Now you''ve done the legwork for me and I
can just leech off your hard work. <grin>

Thanks also for the references to
http://www.alistapart.com/stories/alternate/
and
http://www.w3.org/TR/html401/present....html#h-14.3.2

--
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/
validator: http://jigsaw.w3.org/css-validator/


这篇关于多个链接的样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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