style Property

Returns an FPHTMLStyle object that represents the inline style properties for an element. Corresponds to the style attribute.

expression.style

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

Inline styles are style sheets for a single instance of an element and are specified in the element's opening tag. Inline styles are defined using the style attribute, and the data for the attribute is specified using the cascading style sheet langauge. Use the style property to access and set cascading style sheet properties. For more information about cascading style sheets, see CSS Reference.

Example

The following example sets the background color of the active document.

ActiveDocument.body.Style.backgroundColor = "blue"

The following example sets the background color for the first P element in the document.

ActiveDocument.all.tags("p").Item(0) _
    .Style.cssText = "background-color:yellow"

The following example sets the margin for the active document.

ActiveDocument.body.Style.margin = "10px"

Applies to | FPHTMLAnchorElement Object | FPHTMLAreaElement Object | FPHTMLBaseElement Object | FPHTMLBaseFontElement Object | FPHTMLBGsound Object | FPHTMLBlockElement Object | FPHTMLBody Object | FPHTMLBRElement Object | FPHTMLButtonElement Object | FPHTMLCommentElement Object | FPHTMLDDElement Object | FPHTMLDivElement Object | FPHTMLDivPosition Object | FPHTMLDListElement Object | FPHTMLDTElement Object | FPHTMLEmbed Object | FPHTMLFieldSetElement Object | FPHTMLFontElement Object | FPHTMLFormElement Object | FPHTMLFrameBase Object | FPHTMLFrameElement Object | FPHTMLFrameSetSite Object | FPHTMLFrontPageBotElement Object | FPHTMLHeaderElement Object | FPHTMLHRElement Object | FPHTMLIFrame Object | FPHTMLImg Object | FPHTMLInputButtonElement Object | FPHTMLInputFileElement Object | FPHTMLInputHiddenElement Object | FPHTMLInputImage Object | FPHTMLInputTextElement Object | FPHTMLIsIndexElement Object | FPHTMLLabelElement Object | FPHTMLLegendElement Object | FPHTMLLIElement Object | FPHTMLLinkElement Object | FPHTMLListElement Object | FPHTMLMapElement Object | FPHTMLMarqueeElement Object | FPHTMLMetaElement Object | FPHTMLNextIdElement Object | FPHTMLNoShowElement Object | FPHTMLObjectElement Object | FPHTMLOListElement Object | FPHTMLOptionElement Object | FPHTMLParaElement Object | FPHTMLPhraseElement Object | FPHTMLScriptElement Object | FPHTMLSelectElement Object | FPHTMLSpanElement Object | FPHTMLSpanFlow Object | FPHTMLStyleElement Object | FPHTMLTable Object | FPHTMLTableCaption Object | FPHTMLTableCell Object | FPHTMLTableCol Object | FPHTMLTableRow Object | FPHTMLTableSection Object | FPHTMLTemplateRegionElement Object | FPHTMLTextAreaElement Object | FPHTMLTextElement Object | FPHTMLTitleElement Object | FPHTMLUListElement Object | FPHTMLUnknownElement Object | FPHTMLWebPartElement Object | FPHTMLWebPartZoneElement Object | FPHTMLXSLElement Object | FPHTMLXSLWebPartElement Object | IHTMLElement Object | IHTMLStyleSheetRule Object