Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

22 Setting up CSS for HTML > 22.6 Linking to alternate CSS files > 22.6.3 Customizing the CSS link tag


22.6.3 Customizing the CSS link tag

The generic CSS link tag Mif2Go inserts in your HTML output looks like this:

<link rel="stylesheet" href="MyStyles.css" type="text/css">

Suppose you want to specify additional properties for the CSS file, such as media type. First, you must prevent Mif2Go from writing the generic link tag:

[CSS]

WriteCssLink=No

To specify the link yourself, assign it to the <head> element:

[Inserts]

; You must type the following all on one line:

Head=<link rel="stylesheet" href="MyStyles.css" type="text/css" media="screen">

As an alternative, you could reference the link as a macro (see §28.1 Defining and invoking macros):

[Inserts]

Head=<$MyCSSLink>

[MyCSSLink]

<link rel="stylesheet" href="MyStyles.css" type="text/css" media="screen">

You could even go a step further, and provide a macro variable (see §28.3 Using macro variables) for the value of the attribute, so you can change the value in just one place:

[MyCSSLink]

<link rel="stylesheet" href="MyStyles.css" type="text/css" media="<$$MediaType>">

[MacroVariables]

MediaType=screen



22 Setting up CSS for HTML > 22.6 Linking to alternate CSS files > 22.6.3 Customizing the CSS link tag