替代样式表被认为是有害的(由我,暂时) [英] Alternate Stylesheets Considered Harmful (by me, for the time being)

查看:76
本文介绍了替代样式表被认为是有害的(由我,暂时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[Xposted,f''up to alt.html,comp.infosystems。 www.authoring。样式表]


多年来,我提供了来自我页面的备用样式表的链接,作为每个W3C推荐的


< link rel =" stylesheet" HREF ="巴兹"类型= QUOT;文本/ CSS" title =" Baz"

media =" screen,projection" />

< link rel =" alternate stylesheet" HREF =" FOO"类型= QUOT;文本/ CSS" title =" Foo"

media =" screen,projection" />

< link rel =" alternate stylesheet" HREF ="栏"类型= QUOT;文本/ CSS" title =" Bar"

media =" screen,projection" />


今天早上我删除了备用样式表,只留下了一个

基于cookie的样式表选择器。


为什么?


仅仅因为所有主要CSS支持

浏览器[1]的当前行为是抢先下载*所有*链接样式表,包括<当页面最初加载时,
交替显示。即使是Internet Explorer,

甚至没有提供切换样式表的机制,也表现出这种行为!在我的情况下,这会在初始[2]页面上增加35KB

加载。


确实有些浏览器[3]更进一步下载背景

图像在备用样式表中引用。


因此,在大多数浏览器实现默认样式表之前,我要去

回到基于cookie的样式方法。


< / rant>


[1]在Internet Explorer 5+中注意到这一点, Mozilla 1.x,Opera 7.x,Safari

1.1和Konqueror 3.1,虽然它可能影响其他人。

[2] 10KB页面,5KB默认样式表。< br $>
[3]值得注意的是Konqueror,Safari。


-

Toby A Inkster BSc(荣誉)ARCS

与我联系 - http://www.goddamn.co .uk / tobyink /?page = 132

[Xposted, f''up to alt.html,comp.infosystems.www.authoring.stylesheets]

For ages I have provided links to alternate stylesheets from my pages as
per W3C recommendations:

<link rel="stylesheet" href="baz" type="text/css" title="Baz"
media="screen,projection" />
<link rel="alternate stylesheet" href="foo" type="text/css" title="Foo"
media="screen,projection" />
<link rel="alternate stylesheet" href="bar" type="text/css" title="Bar"
media="screen,projection" />

This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn''t even provide a mechanism to switch style sheets exhibits this
behaviour! In my case, this adds an extra 35KB to the initial[2] page
load.

Indeed some browsers[3] go even further and also download the background
images referenced in alternate stylesheets.

So until most browsers implement default style sheets sanely, I''m going
back to the cookie-based styling method.

</rant>

[1] Noticed this in Internet Explorer 5+, Mozilla 1.x, Opera 7.x, Safari
1.1 and Konqueror 3.1, although it probably effects others.
[2] 10KB page, 5KB default style sheet.
[3] Notably Konqueror, Safari.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

推荐答案

Toby A Inkster写道:
Toby A Inkster wrote:
这个时间我删除了备用样式表,只留下了一个基于cookie的样式表选择器。

为什么?

只是因为所有主要CSS支持的当前行为<浏览器[1]是在页面最初加载时抢先下载*所有*链接样式表,包括
替换。即使是Internet Explorer,它甚至不提供切换样式表的机制也表现出这种行为!
This morning I removed the alternate stylesheets, leaving only a
cookie-based stylesheet selector.

Why?

Simply because the current behaviour of all major CSS-supporting
browsers[1] is to preemptively download *all* linked stylesheets including
alternates when the page initially loads. Even Internet Explorer, which
doesn''t even provide a mechanism to switch style sheets exhibits this
behaviour!




是的,我也玩过与alistapart'的javascript切换器一起工作

与IE,但决定它也是一个下载太多,而且真的很好地补充了互联网的缺点爆炸。


服务器端解决方案很有吸引力,除了你可能会限制搜索引擎参与
。但我认为你可以在普通(X)HTML中使用默认的

页面,使用按钮或链接生成相同的页面,其中包含

不同样式表和服务器端帮助。这样,蜘蛛

不应该错过任何实际内容。

-

欢呼m



Yeah, I also played with alistapart''s javascript switcher which works
with IE, but decided it was also too much of a download, and really
a kind of kludge to patch the shortcomings of Internet Exploder.

The server side solution is attractive, except that you may be limiting
search engine participation. But I think you could have a default
page in normal (X)HTML, with buttons or links to generate the same page with
different style sheets with server side help. That way, the spider
shouldn''t miss any actual content.
--
cheers m


Toby A Inkster< Us ****************** @ deadspam.com>在留言新闻中写道:< pa **************************** @ goddamn.co.uk> ...
Toby A Inkster <Us******************@deadspam.com> wrote in message news:<pa****************************@goddamn.co.uk >...
[没有< rant>的剪辑标签]
< / rant>
[snip rant without <rant> tag]
</rant>




你咆哮不会证实:


第31行,第6栏:元素RANT的结束标记这是不公开的。


---萨法拉(斯蒂芬莫利)---
http://www.safalra.com/hypertext


Safalra写道:
Safalra wrote:
Toby A Inkster< Us ****************** @ deadspam.com>在留言新闻中写道:< pa **************************** @ goddamn.co.uk> ...
Toby A Inkster <Us******************@deadspam.com> wrote in message news:<pa****************************@goddamn.co.uk >...
[没有< rant>的剪辑标签]
< / rant>
[snip rant without <rant> tag]
</rant>



你咆哮不会验证:

第31行,第6列:元素RANT的结束标记;没有打开。



You rant does not validate:

Line 31, column 6: end tag for element "RANT" which is not open.




<!DOCTYPE rant [

<!ELEMENT rant O - (#CDATA) - rant element有可选的开标 - >

]>


-

Toby A Inkster BSc(荣誉)ARCS

与我联系 - http:// www .goddamn.co.uk / tobyink /?page = 132



<!DOCTYPE rant [
<!ELEMENT rant O - (#CDATA) -- rant element has optional opening tag -->
]>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132


这篇关于替代样式表被认为是有害的(由我,暂时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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