Using multiple stylesheets in a project
Using multiple stylesheets in a project
I have a project where all but two topics use the same stylesheet. I've defined a master stylesheet at the project level. When I try to assign a different stylesheet to the two topics, I'm told I'm not allowed because I've defined a master project stylesheet. As a workaround, I can get rid of the master project stylesheet and assign the stylesheet at the topic level, but this seems overly laborious. Is there a way to assign a default stylesheet at the project level that will be used if none is defined at the target or project level? Any guidance is appreciated.
Re: Using multiple stylesheets in a project
You can make the two topics use a different masterpage and insert a different stylesheet into it or simply insert the styles you want to change into the head of that masterpage.
Inge____________________________
"I need input! - Have you got input?"
"I need input! - Have you got input?"
Re: Using multiple stylesheets in a project
Thanks for the reply. I tried adding the following to the <head> section of both a topic-specific master page, and to the topic itself:
<style>
body
{
margin-bottom: 10px;
margin-top: 10px;
margin-left: 10px;
margin-right: 10px;
}
</style>
Unfortunately, in both cases, the statements above appear BEFORE the following statement in the output:
<link href="Resources/Stylesheets/MyCSS.css" rel="stylesheet" />
and are thus overridden.
Anyone know how to make this work (ie how tho make the statements appear AFTER the CSS declaration)?
<style>
body
{
margin-bottom: 10px;
margin-top: 10px;
margin-left: 10px;
margin-right: 10px;
}
</style>
Unfortunately, in both cases, the statements above appear BEFORE the following statement in the output:
<link href="Resources/Stylesheets/MyCSS.css" rel="stylesheet" />
and are thus overridden.
Anyone know how to make this work (ie how tho make the statements appear AFTER the CSS declaration)?
Re: Using multiple stylesheets in a project
Really? Didn't know - sorry about that.
Do you really just want to change the body?
Then dump the masterpage and generate a class for the body in the normal stylesheet:You can assign that class to the body in those topics ...
If you need more than just the body you can still get away with assigning only the body class in the topics, but you would need to generate complex selectors and declare the wanted styles like this:
for the p tag: body.margin10 p { styles go here }
for the table tag: body.margin10 table { styles go here }
You have to make sure that each complex selector is in the stylesheet after its "ancestor", because otherwise the declaration for the ordinary p tag overrides the complex selector one.
Do you really just want to change the body?
Then dump the masterpage and generate a class for the body in the normal stylesheet:
Code: Select all
body.margin10 { margin: 10px; }If you need more than just the body you can still get away with assigning only the body class in the topics, but you would need to generate complex selectors and declare the wanted styles like this:
for the p tag: body.margin10 p { styles go here }
for the table tag: body.margin10 table { styles go here }
You have to make sure that each complex selector is in the stylesheet after its "ancestor", because otherwise the declaration for the ordinary p tag overrides the complex selector one.
Inge____________________________
"I need input! - Have you got input?"
"I need input! - Have you got input?"
Re: Using multiple stylesheets in a project
Yeah, really. Your suggestion to use a class should work however. Never thought about that. Thanks!