Stylesheet or in-line CSS CSS attributes, used in stylesheets or in-line, can define: body, div, p, h1 - h6, hr, table, thead, tr, th, td, blockquote, address, ol, ul, dl, dt, dd span, a, font class e.g..stylename { :9pt; } id e.g. #style { :9pt; } In-line CSS can also be used - useful in substitutions e.g. <p style=":9pt;"> Tag, class and id can share a similar name e.g. p {...}.p {...} and #p {...} are handled uniquely There is limited support for cascaded CSS e.g. div.topic table.type1 td - table, tr, th and td will only be recognised as the last items (as above) - only 'block' elements (not 'in-line') can be included i.e. div.style1 a {...} will not work, nor wil a#class1 {...} Units: px, pc, pt, cm, mm, in, em and % (where appropriate) are supported. Default if no unit given is px. Colours: #rgb or #rrggbb or RGB(255,255,255) or colour names e.g. 'black', 'gray' are supported. HTML Tag Attribute Values allowed BODY px, pc, pt, or small, medium, large, x-small etc., rgb(r,g,b), cmyk(c,m,y,k)works for in-line CSS only - not stylesheets margin-collapse line-height collapse none (custom attribute - collapses top and bottom margins if at top or bottom of page) Line height as a factor of font-height or %. Usual values around 1.2 or 1.3
All Block level tags: P, DIV, H1-H6, BLOCKQUOTE, ADDRESS, DL, OL, UL margin*,, margin-left, margin-right padding*, padding-right, padding-left, padding-top, padding-bottom border, border-top, border-bottom, border-right width page-break-after page-break-inside page-break-before margin-collapse line-height background- Units: px, pc, pt, cm, mm, %, em and in are supported. Default if no unit given is px. Units: px, pc, pt, cm, mm, %, em and in are supported. Default if no unit given is px. Units: px, pc, pt, cm, mm, % and in are supported. Default if no unit given is px. left center right justify auto avoid avoid (avoids a page-break within the block - only works across max. of 2 pages; not compatible with table autosize or table rotate) always left right (this is the only one that actually forces a pagebreak) collapse none (custom attribute - collapses top and bottom margins if at top or bottom of page) Line height as a factor of font-height or %. Usual values around 1.2 or 1.3 background colour only: #rrggbb text-decoration underline line-through normal (line-through = strikethrough) text-transform text-indent uppercase lowercase none (NB disabled for CJK languages) Indents first line of text in the paragraph/block. Units: px, pc, pt, cm, mm, em and in are supported. Default if no unit given is px. (Indent is disabled in tables.) Negative value will give a 'hanging indent'.
All Inline tags: SPAN, A, SUB, SUP, ACRONYM BIG, SMALL INS, S, STRIKE, DEL STRONG, CITE, Q EM, B, I, U, SAMP CODE, KBD, TT, VAR FONT text-decoration underline line-through normal (line-through = strikethrough) text-transform background- outline-width outline- uppercase lowercase none (NB disabled for CJK languages) colour e.g. #rrggbb Width of the outline. Units: px, pc, pt, cm, mm, em and in are supported. Default if no unit given is px. (Outline text is valid CSS, but not supported in browsers) Colour of the inner part of the text e.g. #rrggbb. 'INVERT' is also accepted. (Outline text is valid CSS, but not supported in browsers)
TABLE background- colour e.g. #rrggbb border, border-right, border-top, border-bottom padding*, padding-right, padding-left, padding-top, padding-bottom margin, margin-right, margin-left, vertical-align border-collapse border-spacing empty-cells page-break-inside rotate autosize topntail thead-underline px, pc, or pt only (fixed inheritance in v1.1 - only applies to outside borders of table) medium thin thick accepted for size Table & cell borders accept: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and 'inset' (other block borders do not) if no unit given is px (NB Up to mpdf 1.4 incorrectly set cell-padding for all cells in table.) Sets table padding (only relevant when border-collapse:separate) if no unit given is px. top middle bottom (applies to all cells in table) left right center (applies to all cells in table; to centre a table on the page, you must use the align="center" attribute in the table tag) collapse separate Single or double values: 2px sets horizontal and vertical; 2px 3px sets horizontal=2 and vertical=3 (Same as cellpadding attribute) Default=2px hide show (only relevant when border-collapse:separate) avoid rotates the table 90 degress clockwise (90) or counter-clockwise (-90). Does not work with columns, and bookmarks will not be correctly placed (custom attribute) Shrinks a table to fit if width is too small to allow complete words to fit. The value (must be >1) determines the maximum allowable factor to shrink i.e. autosize="2" will allow the to be reduced to a minimum of 1/2 the original size. (custom attribute) Sets border at top and bottom of table, and below THEAD row if present. (custom attribute) Sets border at bottom of THEAD row if present. (custom attribute added mpdf v1.1) line-height Sets default line-height for table cells as factor or % (value e.g. 1.3) THEAD normal bold vertical-align top middle bottom left center right
TR background- colour e.g. #rrggbb TD, TH background- colour e.g. #rrggbb border, border-right, border-top, border-bottom padding*, padding-right, padding-left, padding-top, padding-bottom white-space vertical-align Will also accept #cccccc 0.1pt solid (which is generated by IE WYSIWYG editor) and (from mpdf 1.4) solid 3mm #000000 medium thin thick accepted for size Table & cell borders accept: 'double', 'solid', 'dashed', 'dotted', 'ridge', 'outset', 'groove', and 'inset' (other block borders do not) if no unit given is px Sets cell-padding for all cells in table. nowrap top middle bottom left right center UL, OL text-indent Indent for each level of list. Units: px, pc, pt, cm, mm, and in are supported. Default if no unit given is px NB The first level can be indented or not: set in configuration files. Margin. Units: px, pc, pt, cm, mm, and in are supported. (NB ONLY above/below the top level of nested lists.) line-height Sets line-height for current list (value e.g. 1.3 or 130%) - inherited by lower level nested lists HR width Units: px, pc, pt, cm, mm, in and % are supported. Default if no unit given is px height left right center e.g. #rrggbb i.e. line-width. Units: px, pc, pt, cm, mm, and in are supported. Default if no unit given is px if no unit given is px
IMG vertical-align top middle bottom baseline text-bottom text-top (only top, middle and bottom are valid in mpdf; the others are coverted to the appropriate nearest type) Sets the text alignment of accompanying text on the same line. Partly supported: if more than one inline image/object is on a line, the last image/object of the line will set the vertical alignment. margin, margin-right, margin-left, border, border-right, border-top, border-bottom (vspace, hspace) width, height if no unit given is px. Will also accept #cccccc 0.1pt solid (which is generated by IE WYSIWYG editor) and (from mpdf 1.4) solid 3mm #000000 medium thin thick accepted for size Attributes - set values for margin-left/right or margin-top/bottom Units: px, pc, pt, cm, mm, em, in and % are supported. NB the inline attributes width="" and height="" are also supported SELECT e.g. #rrggbb TEXTAREA width, height Units: px, pc, pt, cm, mm, em, in and % are supported. NB the inline attributes cols="" and rows="" are also supported e.g. #rrggbb INPUT (IMAGE) width, height Units: px, pc, pt, cm, mm, em, in and % are supported. INPUT (CHECKBOX RADIO) INPUT (PASSWORD TEXT) Notes: width (sets size of glyph). Not inherited. e.g. #rrggbb. Not inherited. Units: px, pc, pt, cm, mm, em, in and % are supported. NB the inline attribute size="" is also supported Text colour e.g. #rrggbb * Margin and padding accept the various shorthand forms e.g.: margin:1pt; will set all top, right, bottom and left values the same margin:1pt 2pt; will set top and bottom to 1pt, left and right to 2pt
margin:1pt 2pt 3pt 4pt; will set all values in order: top>right>bottom>left Generated in 0.57 seconds