Style

From Frontal Wiki

Jump to: navigation, search

Introduction to the style tag

The "style" tag is used to define a style sheet.

The basic form is simply:

<style><![CDATA[
    // Style rule sets go here.
]]></style>

A document may have as many style tags as you like and they may be in any order relative to the document elements that they are modifying. For example, this definition:

<style><![CDATA[
    text { color: red; }
]]></style>
<text>The text is red.</text>

is equivalent to this:

<text>The text is red.</text>
<style><![CDATA[
    text { color: red; }
]]></style>

It is sometimes convenient to have styles defined in a separate file so that they may be included into several Frontal definitions. To do this, just create a file with your style tag and it contents in it. For example, perhaps there is a file named styles.xml with this content:

<style><![CDATA[
    text { color: red; }
]]></style>

Then you may use that file in your Frontal definition like so:

<include rel="inline" src="styles.xml" />
<text>The text is red.</text>

Defining a style sheet is discussed in the Frontal Style Sheets and the More Frontal Style Sheets sections. See those sections for more details.

Implementation

The styles tag is implemented by the DocElemStyles class which is a subclass of the DocumentElement class and so has all the properties, methods and styles associated with that class. It adds no public properties, methods or styles.

Personal tools
Get Adobe Flash player