Skip to content



TWebCSSClass is a non-visual component that allows to set at design-time (but also in run-time via code), properties of a CSS class. You can select the CSS classname for this component and then use this CSS class to style controls on the form. When changing properties of TWebCSSClass at run-time, either use this in a block WebCSSClass.BeginUpdate / WebCSSClass.EndUpdate or call WebCSSClass.UpdateCSS to have it updated at run-time and applied in the browser. Note that when many property values or 0, clNone, empty string, … these CSS style properties are not generated. The TWebCSSClass tries to generate the minimum CSS properties of the CSS class.

Designtime Runtime

Properties for TWebCSSClass

Property Description
BackgroundColor: TColor Sets the HTML element background color
Border: TCSSBorder Holds the settings for the entire element border
BorderBottom: TCSSBorder Sets the characteristics of the bottom border of the HTML element when used
BorderLeft: TCSSBorder Sets the characteristics of the left border of the HTML element when used
BorderRight: TCSSBorder Sets the characteristics of the right border of the HTML element when used
BorderTop: TCSSBorder Sets the characteristics of the bottom border of the HTML element when used
BorderBottomLeftRadius Sets the rounding radius of the bottom left corner
BorderBottomRightRadius Sets the rounding radius of the bottom right corner
BorderTopLeftRadius Sets the rounding radius of the top left corner
BorderTopRightRadius Sets the rounding radius of the top right corner
BorderRadius Sets the rounding radius of the HTML element 4 corners
BoxShadow: TCSSBoxShadow Sets the characteristics of the shadow for the HTML element
Color: TColor Sets the text color in the HTML element
CSSClassName: string Sets the name of the CSS class that will be generated in the DOM
Cursor: TCSSCursor Sets the cursor to be used when the mouse is over the HTML element. Possible values are: cuDefault cuCrosshair, cuPointer, cuMove, cuEResize, cuNEResize, cuNWResize, cuNResize, cuSEResize, cuSWResize, cuSResize, cuWResize, cuText, cuWait, cuHelp
Display: TCSSDisplay Sets the CSS display property. Possible values are: cdNone, cdInline, cdBlock, cdInlineBlock, cdListItem, cdRunIn, cdCompact, cdTable, cdInlineTable
Font: TCCSFont Sets the CSS characteristics of the font used in the HTML element
Height: TCSSSize Sets the element height CSS characteristics
Margin: TCSSSize Sets the element margin CSS characteristics
MarginBottom: TCSSSize Sets the element bottom margin CSS characteristics
MarginLeft: TCSSSize Sets the element left margin CSS characteristics
MarginRight: TCSSSize Sets the element right margin CSS characteristics
MarginTop: TCSSSize Sets the element top margin CSS characteristics
Opacity: single Sets the HTML element opacity
Overflow: TCSSOverflow Sets the CSS overflow property. Possible values are: ofNone, ofVisible, ofHidden, ofScroll, ofAuto, ofNoDisplay, ofNoContent
OverflowX: TCSSOverflow Sets the CSS width overflow property
OverflowY: TCSSOverflow Sets the CSS height overflow property
Padding: TCSSPadding Sets the element padding CSS characteristics
PaddingBottom: TCSSPadding Sets the element bottom padding CSS characteristics
PaddingLeft: TCSSPadding Sets the element left padding CSS characteristics
PaddingRight: TCSSPadding Sets the element right padding CSS characteristics
PaddingTop: TCSSPadding Sets the element top padding CSS characteristics
Text: TCSSText Sets the CSS text formatting properties
Width: TCSSSize Sets the element width CSS characteristics

Properties for TCSSBorder

Property Description
Color: TColor Sets the border color
Style: TBorderStyle Sets the border style. Possible values are: bsnone, bshidden, bsdotted, bsdashed, bssolid, bsdouble, bsgroove, bsridge, bsinset, bsoutset, bsinitial, bsinherit
Width: TBorderWidth Sets the border width. Possible values are: bwnone, bwthin, bwmedium, bwthick, px1, px2, px3, px4, px5, px6, px7, px8, px9, px10

Properties for TCSSBoxShadow

Property Description
HOffset: integer Depth of the shadow in the horizontal direction
VOffiset: integer Depth of the shadow in the vertical direction
Blur: integer Blur of the shadow
Color: TColor Color of the shadow
Spread: integer Spread of the shadow

Properties for TCSSFont

Property Description
Style: TCSSFontStyle Font style. Possible values are: fssNormal, fssItalic, fssOblique, fssInherit
Variant: TCSSFontVariant Font variant characteristics. Possible values are: fvNormal, fvSmallCaps, fvInherit
Weight: TCSSFontWeight Font weight. Possible values are: fwNormal, fwBold, fwBolder, fwLighter, fw100, fw200, fw300, fw400, fw500, fw600, fw700, fw800, fw900, fwinherit
Size: TCSSFontSize Font size. Possible values are: fszxxsmall, fszxsmall, fszsmall, fszmedium, fszlarge, fszxlarge, fszxxlarge, fszsmaller, fszlarger, fszInherit.
Family: string Font family name
Stretch: TCSSFontStretch Font stretching characteristics. Possible values are: fsUltraCondensed, fsExtraCondensed, fsCondensed, fsSemiCondensed, fsNormal, fsSemiExpanded, fsExpanded,fsUltraExpanded, fsExtraExpanded, fsInherit
SizePx: double Font size in pixels
SizePct: integer Font size in percent

Properties for TCSSText

Property Description
Align: TCSSTextAlign Sets the horizontal alignment of text in the HTML element. Possible values are: taStart, taEnd, taLeft, taRight, taCenter, taJustify
Decoration: TCSSTextDecoration Sets optional text decoration. Possible values are: tdNone, tdUnderline, tdOverline, tdLineThrough, tdBlink
Direction: TCSSTextDirection Sets the text direction CSS property. Possible values are: tdltr, tdrtl, tdinherit
Justify: TCSSTextJustify Sets the text justification CSS property. Possible values are: tjAuto, tjInterword, tjInterIdeoGraph, tjInterCluster, tjDistribute, tjKashida, tjTibetan
LineHeightPx: double Sets the text line height in pixels
Shadow: TCSSTextShadow Sets the optional shadow for rendered text
Wrap: TCSSTextWrap Font size in pixels

Properties for TCSSPadding

Property Description
Type: TCSSPaddingType Sets the type of padding to apply. Possible values are: ptLength, ptPercent
Value: double Sets the value of padding in pixels

Properties for TCSSSize

Property Description
Type: TCSSSizeType Sets the type of size to apply. Possible values are: stAuto, stLength, stPercent
Value: double Sets the value of size in pixels