Multiple alternate stylesheets
Suppose a site is very configurable, and it has a few orthogonal settings which are all easily controlled with alternate stylesheets. For example, its main menu can be at the top or on the left, and its background colour can be red or blue.
Is there a way to define multiple sets of alternate stylesheets so that we can replace the 'theme' for each set?
I'm looking for something like this:
<link rel="stylesheet" set="background" title="red" />
<link rel=开发者_如何转开发"alternate stylesheet" set="background" title="blue" />
<link rel="stylesheet" set="main-menu" title="left" />
<link rel="alternate stylesheet" set="main-menu" title="top" />
No you can't do that. The three ways are:
- Have a set of sheets on the server, and serve the correct one
- Use inline CSS
- Combination of both. Load all unchangable classes in an external CSS, then use an inline style sheet to set the customisable values.
精彩评论