Textpattern

Return to main site

Related

Frequently Asked Questions

Can I use multiple CSS stylesheets?

Q.

How do I include several CSS stylesheets on a page?
How do I link to a style by name?
How do I use a CSS stylesheet for printing?

A.

The standard CSS stylesheet link in the default template looks like this:

<link rel="stylesheet" href="<txp:css />" type="text/css" media="screen" />

The <txp:css /> part tells Textpattern to use the stylesheet associated with the current section (see presentation > sections).

You can link to additional stylesheets on the same page by referring to them by name. Create another style (under presentation > styles) and add an extra line to your template like this:

<link rel="stylesheet" href="<txp:css n="my_style_name" />" type="text/css" media="screen" />

The n parameter specifies the name of the stylesheet. Read more at TextBook.

To add a print-only stylesheet, create one named print and add this to your page template:

<link rel="stylesheet" href="<txp:css n="print" />" type="text/css" media="print" />

Posted 4 January 2006, 08:47 by Alex Shiels

---