Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Can there be more than one CSS?

Can there be more than one CSS?

When I add a file under the stylesheet folder
I get an article-like screen when I double click on the file.

Is my idea wrong of wanting more then one CSS per site?

If it is possible to have more than one CSS per site, where do I set it in an article. In other words: If i'm right, if there is a CSS, it's stated in the head section when the article is published. But what if there are two or more CSS and you want to give different articles different CSS links (one per article ofcourse).

Hope my target is clear...

Bert
Friday, February 20, 2004

Yes you can have more than one style sheet pre site.  There are a number of ways to link different sheets to different pages depending on what you're trying to accomplish.  Since the style sheet is linked in the head section of an html file a very simple approach would be to use different templates for pages you wanted to style differently.  Another technique would be to put the magic name of the style sheet you wanted to associate with an article into one of the article fields such as extra1 and reference that in the template.  There are also ways within css to style differently based on the name of the current page.

Ken McKinney
Friday, February 20, 2004

I write my css in an article that I put in a folder called stylsheet.  First, make a new template with the extension of .css

Then, create your css article (as many as you need) and assign the .css template to it.

The css template should only contain this:

{$.body$}


In your article templates that you use for your site content, make sure you have a <link> tag that contains the css file you want for your article.  If you don't know how to write that tag, copy the line for the default CityDesk Template.  Just replace the filename they use with your css magic name.

joel goldstick
Friday, February 20, 2004

Huh? you create 2 static .css files in a folder, then duplicate your template, only changing the line that points to the CSS file. Whenever you create an article, select the template to use.

For simplicity sake, even though it eats up bandwidth, I have my CSS in the HTML page because it makes working with the templates easier.

Unless you want a site that can have multiple appearances at the push of a CSS button, in which case, you'd really ebtter learn CSS.

www.MarkTAW.com
Friday, February 20, 2004

*  Recent Topics

*  Fog Creek Home