开发者

Multiple alternate stylesheets

开发者 https://www.devze.com 2023-02-13 11:11 出处:网络
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 i

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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号