Rich text reference

From PhiWiki
Jump to: navigation, search

This reference contains the available HTML subset Phi supports for marking up text and the supported style sheet attributes for Rich text and Rich text layouted.

Supported tags

a

Anchor or link. Supports the href attribute. Use the style

<a href="javascript:phi.href('url');">my link</a>

to automatically set the phisid (session id) and philang (current used language) for the link - this works in both Phi and HTML mode.

address

Describes an address.

b

Writes text in bold font.

big

Writes text in a larger font.

blockquote

Displays the text in an indented paragraph.

br

Generates a line break.

<br />

code

Writes code in a fixed font size. Same as 'tt'.

dd

Definition data.

dfn

Definition (same as 'i').

div

Document division. The following attributes are supported:

  • align (left, right, center, justify)
  • dir (ltr, rtl)

dl

Definition list.

dt

Definition term.

em

Writes text emphasized. Same as 'i'.

h1 - h6

Level 1 - 6 heading. The following attributes are supported:

  • align (left, right, center, justify)
  • dir (ltr, rtl)

hr

Draws a horizontal line. Supports the width attribute, which can be specified as an absolute or relative (%) value.

i

Writes italic text.

li

List item in an ordered or unordered list.

<ul>
  <li>list item 1</li>
 </ul>

nobr

Writes non-breakable text.

ol

Draws an ordered list. The following types are supported:

  • 1
  • a
  • A
  • square
  • disc
  • circle

p

Prints a paragraph which is left-aligned by default. The following attributes are supported:

  • align (left, right, center, justify)
  • dir (ltr, rtl)

pre

Prints preformated text.

s

Writes strikethrough text.

samp

Prints sample code (same as 'tt').

small

Writes text in a smaller font.

span

Groupes elements.

strong

Writes strong text (same as 'b').

sub

Writes a subscripted text.

sup

Writes a superscripted text.

table

Draws a table. Supports the following attributes: border, bgcolor (with #RRGGBB), cellspacing, cellpadding, width (absolute or relative), and height.

The following attributes are supported by the 'td' and 'th' tags:

  • width (absolute, relative, or no-value)
  • bgcolor (#RRGGBB)
  • colspan
  • rowspan
  • align (left, right, center, justify)
  • valign (top, middle, bottom)

tbody

Defines a table body.

td

Prints a table data cell.

tfoot

Defines a table footer.

th

Prints a table header cell.

thead

Defines a table header.

tr

Defines a table row. Supports the bgcolor attribute, which can be a a #RRGGBB color specification.

tt

Writes text in a typewrite font.

u

Writes underlined text.

ul

Draws an unordered list. The following types are supported:

  • 1
  • a
  • A
  • square
  • disc
  • circle

var

Defines a variable (same as 'i').

Supported CSS

Rich text items in Phi currently support a subset of the official CSS 2.1 specification.

background-color

Background color for elements (#RRGGBB).

background-color:<color>

border-color

Border color for text tables only.

border-color:<color>

border-style

Defines the border style for text tables.

  • none
  • dotted
  • dashed
  • dot-dash
  • dot-dot-dash
  • solid

color

Text foreground color (#RRGGBB).

color:<color>

float

Specifies where text will be placed in another element. This property is only supported for tables.

  • left
  • right
  • none

font

Font shorthand property.

font:<'font-style'> <'font-weight'> <'font-size'> <'font-family'> 

font-family

Requested font family name.

font-family:<family name>

font-size

Font size relative to the document font, or specified in points or pixels.

  • small
  • medium
  • large
  • x-large
  • xx-large
font-size:<size>pt
font-size:<size>px

font-style

Specifies the font style.

  • normal
  • italic
  • oblique
font-style:<style>

font-variant

Perform the smallcaps transformation on the text prior to displaying it.

font:variant:small-caps

font-weight

Specifies the font weight used for text.

  • normal
  • bold
  • 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

margin

Margin in pixels.

margin:<length>px	
margin-top:<length>px	
margin-left:<length>px	
margin-right:<length>px
margin-bottom:<length>px	

padding

Cell padding in pixels.

padding:<length>px
padding-top:<length>px
padding-left:<length>px
padding-right:<length>px
padding-bottom:<length>px

text-decoration

Specifies the text effect.

  • none
  • underline
  • overline
  • line-through

text-indent

First line text indentation in pixels.

text-indent:<length>px

text-transform

Selects the transformation that will be performed on the text prior to displaying it.

  • uppercase
  • lowercase

vertical-align

Vertical text alignment. For vertical alignment in text table cells only middle, top, and bottom apply.

  • baseline
  • sub
  • super
  • middle
  • top
  • bottom

white-space

Defines how whitespace are handled.

  • normal
  • pre
  • nowrap
  • pre-wrap

word-spacing

Specifies an alternate spacing between each word.

word-spacing:<width>px