caption: Styles and Classes created: 20131205160532119 modified: 20230726105744098 tags: WikiText [[How to apply custom styles]] title: Styles and Classes in WikiText type: text/vnd.tiddlywiki CSS styles and classes can be applied to inline or block content wrapped in `@@double at signs@@`. Classes can be applied to certain block WikiText elements. //Inline content// wrapped in `@@double at signs@@` without specifying style or class will be assigned the `tc-inline-style` class and displayed as highlighted text. The foreground and background colours of the highlighted text are defined as `highlight-background` and `highlight-foreground` in the current palette. <> !! Styles Multiple style attributes, e.g. `color`, each followed by `;` semicolon can be introduced immediately after the opening `@@`, without spaces in between. <> Similarly, styles can be applied to //block content//. Wrapping block content in `@@` without specifying style or class has no effect. <> !! Classes The following `coloured-text` and `coloured-bg` classes are defined in this tiddler for demonstration purposes: ``` .coloured-text {color: darkkhaki;} .coloured-bg {background-color: cornsilk;} ``` Multiple classes, each prefixed with `.`, can be introduced immediately after the opening `@@`, followed by a ` ` space. This works both for inline and block content: <> <> Multiple classes and styles can be applied simultaneously. In case of inline content, the styles have to be defined first, followed by the classes. <> In case of block content, the styles and classes can be defined in a single line after the opening `@@` identically as for the inline content, or in separate lines, each beginning with `@@`: <> In a similar way classes, but not styles, can be applied to those block WikiText elements that are introduced through characters on the beginning of the line. The classes prefixed with `.` are specified immediately after the special characters, followed by a ` ` space. <>