译文:网页样式表 - CSS的提示与窍门
英文:
http://www.w3.org/Style/Examples/007/alternatives
说明:
翻译: Chinese Translation Services
一份文挡并不需要单个样式表。你可以给它一个默认的样式,并从中为读者提供几种选择,比如说,本页拥有所有的 W3C 的核心样式, 以及其它网络上找到的两个样式表(作者:David Baron)来做为“交替样式”。
至于读者如何选择“交替样式”则是取决于浏览器,并不是所有的浏览器对此都提供菜单。然而,以Netscape第六版本为例,你却可以在菜单里的“view”(查看)->“Use Stylesheet”(使用样式表)找到所有的样式。
如要把额外的样式表也包括在里面,则在页头处添加更多的〈LINK〉元素便可,而且要用对REL和TITLE的属性,就象以下所表示的。(我把某些样式拿掉了;见本文档的资源以得到更多链接。)
<link rel="stylesheet"
title="Gold (right, fixed) + navbar"
href="../threepart-f.css">
<link rel="alternate stylesheet"
title="Oldstyle"
href="http://www.w3.org/StyleSheets/Core/Oldstyle">
<link rel="alternate stylesheet"
title="Modernist"
href="http://www.w3.org/StyleSheets/Core/Modernist">
...
<link rel="alternate stylesheet"
title="Steely"
href="http://www.w3.org/StyleSheets/Core/Steely">
<link rel="alternate stylesheet"
title="Forest (by David Baron)"
href="http://dbaron.org/style/forest">
<link rel="alternate stylesheet"
title="Plain (by David Baron)"
href="http://dbaron.org/style/plain">
带有相同“TITLE”的链接组会被自动组合在一起从而形成一种样式表。