# Using CSS with the speedata Publisher

Remark: The support of CSS was introduced in version 2.2. At that time, it is more a proof-of-concept than a full implementation. The interface might change in the future. When in doubt, just ask.

## Loading a stylesheet and declaring CSS rules

CSS Stylesheets are defined with the command `Stylesheet`:

    <Stylesheet filename="rules.css"/>

or

    <Stylesheet>
      td {
        vertical-align: top ;
      }
    </Stylesheet>

With these rules, some of the XML elements in the layout stylesheet (currently `Box`, `Frame`, `Rule`, `Paragraph`, `Tablerule`, `Td`) can be styled. As it is common with CSS, you can set the properties with the class name, the id and the command name.

For this table

    <PlaceObject>
      <Table>
        <Tr minheight="4">
          <Td class="myclass" id="myid"><Paragraph><Value>Hello world</Value></Paragraph></Td>
        </Tr>
      </Table>
    </PlaceObject>

each of the following CSS declarations have the same effect:

    #myid {
      vertical-align: top ;
    }

    .myclass {
      vertical-align: top ;
    }

und

    td {
      vertical-align: top ;
    }

The mapping of the command names for the CSS rules and the layout rules are documented in the reference manual.

Version: 2.4.5 | Start page | Element reference | Other language: German