共用方式為


IHTMLCurrentStyle interface

Provides the ability to programmatically access the style properties of the element.

Members

The IHTMLCurrentStyle interface inherits from the IDispatch interface. IHTMLCurrentStyle also has these types of members:

  • Methods
  • Properties

Methods

The IHTMLCurrentStyle interface has these methods.

Method Description
getAttribute

Retrieves the value of the specified attribute.

 

Properties

The IHTMLCurrentStyle interface has these properties.

Property Access type Description

accelerator

Sets or retrieves a string that indicates whether the object represents a keyboard shortcut.

backgroundAttachment

Specifies how the background image (or images) is attached to the object within the document.

backgroundColor

Specifies the color behind the content of the object.

backgroundImage

Specifies the background image or images of the object.

backgroundPositionX

Specifies the x-coordinate of the IHTMLRuleStyle::backgroundPosition property.

backgroundPositionY

Specifies the y-coordinate of the IHTMLRuleStyle::backgroundPosition property.

backgroundRepeat

Specifies whether and how the background image (or images) is tiled.

behavior

Sets or retrieves the location of the Dynamic HTML (DHTML) behaviorDHTML Behaviors.

blockDirection

Gets a string value that indicates whether the content in the block element flows from left to right, or from right to left.

borderBottomColor

Specifies the foreground color of the bottom border of an object.

borderBottomStyle

Specifies the style of the bottom border of the object.

borderBottomWidth

Specifies the thickness of the bottom border of the object.

borderCollapse

Indicates whether the row and cell borders of a table are joined in a single border or detached as in standard HTML.

borderColor

Specifies the border color of the object.

borderLeftColor

Specifies the foreground color of the left border of an object.

borderLeftStyle

Sets or retrieves the style of the left border of the object.

borderLeftWidth

Specifies the thickness of the left border of the object.

borderRightColor

Specifies the foreground color of the right border of an object.

borderRightStyle

Specifies the style of the right border of the object.

borderRightWidth

Specifies the thickness of the right border of the object.

borderStyle

Specifies the style of the left, right, top, and bottom borders of the object.

borderTopColor

Specifies the foreground color of the top border of an object.

borderTopStyle

Specifies the style of the top border of the object.

borderTopWidth

Specifies the thickness of the top border of the object.

borderWidth

Specifies the thicknesses of the left, right, top, and bottom borders of an object.

bottom

Sets or retrieves the bottom position of the object in relation to the bottom of the next positioned object in the document hierarchy.

clear

Specifies whether the object allows floating objects on its left side, right side, or both, so that the next text displays past the floating objects.

clipBottom

Gets the bottom coordinate of the object clipping region.

clipLeft

Gets the left coordinate of the object clipping region.

clipRight

Gets the right coordinate of the object clipping region.

clipTop

Read-only

Gets the top coordinate of the object clipping region.

color

The foreground color of the text of an object.

cursor

Specifies the type of cursor to display as the mouse pointer moves over the object.

direction

Specifies the reading order of the object.

display

Gets or sets a value that indicates whether and how the object is rendered.

fontFamily

Specifies the name of the font used for text in the object.

fontSize

Specifies a value that indicates the font size used for text in the object.

fontStyle

Specifies the font style of the object as italic, normal, or oblique.

fontVariant

Specifies whether the text of the object is in small capital letters.

fontWeight

Gets the numeric weight of the font of the object.

height

Sets or retrieves the height of the object.

imeMode

Specifies the state of an IME.

layoutGridChar

Specifies the size of the character grid used for rendering the text content of an element.

layoutGridLine

Specifies the gridline value used for rendering the text content of an element.

layoutGridMode

Specifies whether the text layout grid uses two dimensions.

layoutGridType

Specifies the type of grid used for rendering the text content of an element.

left

Sets or retrieves the position of the object relative to the left edge of the next positioned object in the document hierarchy.

letterSpacing

Specifies the amount of additional space between letters in the object.

lineBreak

Specifies line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean.

lineHeight

Sets or retrieves the distance between lines in the object.

listStyleImage

Sets or retrieves a value that indicates which image to use as a list-item marker for the object.

listStylePosition

Sets or retrieves a variable that indicates how the list-item marker is drawn relative to the content of the object.

listStyleType

Sets or retrieves the predefined type of the line-item marker for the object.

margin

Sets or retrieves the width of the top, right, bottom, and left margins of the object.

marginBottom

Sets or retrieves the height of the bottom margin of the object.

marginLeft

Sets or retrieves the width of the left margin of the object.

marginRight

Sets or retrieves the width of the right margin of the object.

marginTop

Sets or retrieves the height of the top margin of the object.

overflow

Sets or retrieves a value indicating how to manage the content of the object when the content exceeds the height or width of the object.

overflowX

Sets or retrieves how to manage the content of the object when the content exceeds the width of the object.

overflowY

Sets or retrieves how to manage the content of the object when the content exceeds the height of the object.

padding

Sets or retrieves the amount of space to insert between the object and its margin or, if there is a border, between the object and its border.

paddingBottom

Sets or retrieves the amount of space to insert between the bottom border of the object and the content.

paddingLeft

Sets or retrieves the amount of space to insert between the left border of the object and the content.

paddingRight

Sets or retrieves the amount of space to insert between the right border of the object and the content.

paddingTop

Sets or retrieves the amount of space to insert between the top border of the object and the content.

pageBreakAfter

Sets or retrieves a value indicating whether a page break occurs after the object.

pageBreakBefore

Defines whether a page break occurs before the object.

position

Sets or retrieves the type of positioning used for the object.

right

Sets or retrieves the position of the object relative to the right edge of the next positioned object in the document hierarchy.

rubyAlign

Gets or sets a value that indicates how to align the ruby text content.

rubyOverhang

Gets or sets a value that indicates whether, and on which side, ruby text is allowed to partially overhang any adjacent text in addition to its own base, when the ruby text is wider than the ruby base

rubyPosition

Gets or sets a value that controls the position of the ruby text with respect to its base.

styleFloat

Sets or retrieves on which side of the object the text will flow.

tableLayout

Sets or retrieves a string that indicates whether the table layout is fixed.

textAlign

Specifies whether the text in the object is left-aligned, right-aligned, centered, or justified.

textAutospace

Specifies the autospacing and narrow space width adjustment of text.

textDecoration

Specifies a value that indicates whether the text in the object has blink, line-through, overline, or underline decorations.

textIndent

Specifies the indentation of the first line of text in the object.

This property is not supported for Windows apps using JavaScript.

textJustify

Specifies the type of alignment used to justify text in the object.

textTransform

Specifies the rendering of the text in the object.

top

Sets or retrieves the position of the object relative to the top of the next positioned object in the document hierarchy.

unicodeBidi

Read/write

Specifies the level of embedding with respect to the bidirectional algorithm.

verticalAlign

Sets or retrieves the vertical alignment of the object.

visibility

Sets or retrieves whether the content of the object is displayed.

width

Specifies the width of the object.

wordBreak

Specifies line-breaking behavior within words, particularly where multiple languages appear in the object.

zIndex

Sets or retrieves the stacking order of positioned objects.

 

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IDispatch

Reference

IHTMLCurrentStyle2

IHTMLCurrentStyle3

IHTMLCurrentStyle4