| re: Access style by name of external file?
Markus Ernst wrote:
[color=blue]
> Hi
>
> I build a small content management system. I use different external
> stylesheets for the admin section and the frontend, called admin.css and
> frontend.css.
>
> Now I would like to preview some frontend stuff in the admin section. Is
> there a syntax for accessing a style from a different style sheet?[/color]
Not that I know of, however I'm new to CSS.
[color=blue]
> For
> example:
>
> admin.css says:
> h1 {
> color:red;
> }
> p {
> font-family:sans-serif;
> }
>
> frontend.css says:
> h1 {
> color:blue;
> }
> p {
> font-family:serif;
> }
>
> in a file admin.html I would like to do something like:
>
> <head>
> <link rel="stylesheet" href="admin.css" type="text/css">
> <link rel="alternate stylesheet" href="frontend.css" type="text/css">
> </head>
> <body>
> <h1>Red headline</h1>
> <p>Some sans serif text here</p>
>
> <div stylesheet="use alternate stylesheet, is that possible?">
> <h1>Blue headline</h1>
> <p>Some serif text here</p>
> </div>
>
> </body>
>
> I am grateful for a hint on that.[/color]
If you can't find a clean CSS solution, & this is just for internal
previewing, how about duplicating your stlyesheets & then indenting each
line in each such duplicate with something like
..sheet<name>
for some suitable <name>
You can then apply any of those styles by including within an object to
whom you give class sheet<name> & linking to the indented sheets.
If you need to make many changes to the sheets & preview each time, you
could automate generation of the indented sheets with a little bit of
perl or other suitable language.
Maybe you'll get a simpler solution.
--
Michael
m r o z a t u k g a t e w a y d o t n e t |